I am not after Pie chart per say but actually a sunburst chart. A
Sunburst is a radial space-filling visualization technique for
displaying tree like structures. See this JavaScript example:
http://mbostock.github.com/d3/ex/sunburst.html
I see -- cool!
For a starter , I am looking for two things:
1) to make a sunburst based on a tree structure data (small genetics
data)
2) to give it some sort of simple transition animation (shrinking or
enlarging a section when clicked in or out).
However, in the future I would love to enhance the second point and be
able to have similar effects to what DaisyDisk program has (see this
movie at 1:30 second http://www.youtube.com/watch?v=ceJ0Fb0TnEg).
DaisyDisk uses an advanced sunburst chart to help the user to find
where are all large files/directories on her harddisk.
This sort of interaction offered by DaisyDisk seems to help the end
user to keep tracking where they are when browsing the tree espically
when it has many levels and nodes. When using DaisyDisk I notched when
mouse hovers over a segment it changes its alpha channel threshold to
dim or increase the color intensity and more importantly when the user
click a segment it transforms to a whole circle and act as the root
for the sunburst chart. This kind of interaction is my end goal for my
open source project.
Since you are the main developer of floatcanvas , I would like to hear
your opinion if these ideas are doable with wxPython/floatcanvas
especially the animation part or should I look into pygame, pyglet or
any other modules to code my sunburst diagram.
I think FloatCanvas would be fine for this the animation is minimal, I don't think you'll have a performance issue with it.
The one "missing piece" is the alpha channel -- FloatCanvas is built on wx.DC, which does not support alpha blending. However, you can get around that in two ways:
1) in the example, you don't necessarily need to use alpha blending -- you can just have the color change to get brighter and darker, but still be completely opaque.
2) you can use a wxGCDC, instead of the regular DC in your own custom DrawObjects, thenyou could use Alpha blending. A bit more code to write, but you'll be writing you own drawobjects anyway.
There is an example of that here:
http://trac.paulmcnett.com/floatcanvas/wiki/AlphaCircle
Aside from that, be sure to look at the Demos in SVN, there are lots of small, self-contained examples in there.
I also have some Wind Rose that is similar, but simpler, to a sunburst diagram.
I've enclosed that code, though it depends on a bunch of other in-house modules of mine to run (sorry about that). I can get you those later, or one of us could re-work it to to use canned data to demo and test purposes (no idea why I didn't do that in the first place)..
But you can get ideas from the code, anyway.
In short, you will still have a fair bot of code to write, but FloatCanvas will give you some infrastructure that will make it easier. And it will be more infrastructure than pygame or pyglet will give you.
If you want to proceed, why don't you post further questions on the FloatCanvas list -- I like to have an archive of discussion there:
http://mail.paulmcnett.com/cgi-bin/mailman/listinfo/floatcanvas
-Chris
FC_Rose.py (18.1 KB)
···
On 7/26/11 7:38 AM, sa9 wrote:
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker@noaa.gov