02 Mar 2006

canvasgraph 0.8 preview

just like to update interested people on the progress of the next release of canvasgraph.

1. rewritten most of the rendering routines so that it is now broken out into a separate class. this means the most complex bit of the library, the layout engine, will be independent of the technology used to render the graphs. so that allows us to write an SVG, or even DIV/PNG renderer. i don't think the SVG renderer will be part of the next release, but will probably rear it's head later when people are familiar with the new rendering API.

2. i've added some basic mouse events. although the interface to these are not final yet, but basically it supports onclick, onmouseover, onmouseout and onmousemove on bar charts (every individual bar) and line charts (when inside the line chart). along with that, you get the x and y values of the dataset you are looking at, so it adds the possibility of doing some nice overlays.

3. as a result of breaking out the rendering engine, you can now customise the look and feel by not needing to know much of how the graph is laid out. this is an example of how a graph can be rendered in version 0.8


looks familiar doesn't it? this is the same style, right down to the colours as the microsoft office 12 graphs i blogged about previously. i loved those graphs so much that part of the goal in the redesign was to allow maximum flexibility with the renderers. these graphs look better in safari than firefox because firefox does not have support for shadows on the canvas (even though it is in the specification).

4. i'm considering a name change for the project from canvasgraph to PlotKit because it is now sufficiently different and the API will definitely be broken between 0.7 and 0.8. it isn't called GraphKit because there Apple has some frameworks called GraphKit that is used to do directed graphs. and actually, that is true because what i'm doing is not graphing, but plotting. just that when you were a kid, you used to call it graph paper and not plot paper, so i always had the idea that these are graphs. maybe someone can come up with a better suggestion for a name

5. once i have the name settled, then i'll setup a public project mailing list for interested people. right now it's only been me who's developing it because it allows more flexibility with rewriting stuff. but i think at this point i'm ready for the library to stablise.

6. i'll probably remove the phrase that implies opera 9 works, because it doesn't. i just tried opera 9 to draw some graphs, and its all wrong. things either don't draw or just drawn wrong: [UPDATE: it seems like opera 9.0 preview 2 is working with the canvas stuff properly again, or at least the latest one from their site.]


compared to safari:


You can reply to me about this on Twitter: