A day or two ago, I was doing some calculations and plots in octave the other day, and took a break to check my blog stats. It occurred to me that the animated flash chart that appears on my blog was heads-and-shoulders prettier than the simplistic 2d plotting done with gnuplot. Gnuplot is not antialiased, not animated, and doesn’t support alpha blending, whereas my blog stats do.
Like any good open source coder, I decided that I could change that. I made a custom Gtk widget that uses clutter and cairo to produce animated 2d plots. The entire thing is an embeddable clutter scene with its actors rendered by cairo, which means that its antialiased, animated, and can do alpha-blending. It still needs to have its API polished up so its usable by developers, but I’m pretty happy with how the plot turned out. Check out the video
Planet Users:click here to see it in action, or, just check out this screenshot:
A coder can add this plot easily with code like this:
grph = gltz_graph_new ();
gltz_graph_add_pts (grph, 10, 20, TRUE);
gltz_graph_add_pts (grph, 50, 110, TRUE);
gltz_graph_add_pts (grph, 100, 0, TRUE);
You’ll have to figure out how to pack and expose the widget into the window yourself, but if you’re a GUI programmer, you can probably see how easy it is to throw this in your app.
Its still a work-in-progress, and I need to work out a better coordinate designation scheme for the users. (right now, the points are just placed in x-y position, with the UR corner being 0,0) I also need to provide some mechanisms for user customization of the animation and of the appearance, but those are small issues. I’ll publish the code in a few days, once its not ugly anymore :D.