PDA

View Full Version : Specialized Graph/Visualization Component for Flex 3


Flexibol
09-13-2009, 11:36 AM
Hello,

First time poster. I've tried some rudimentary searches of these forums for any previous relevant information but couldn't find any so I'm posting this question here.

I'm trying to put together a specialized graphing/visualization component for Flex 3. Sadly, I can't use existing graph/charting components. However, I'm not entirely sure how to structure this thing from the Graphics API point of view.

The graph/visualization will need to respond to updates in the underlying data (a real-time stream of information). It will also be interactive by using the mouse for zooming/panning etc.

My questions are as follows:

- Should I be subclassing Canvas or something else? It needs to be a Flex 3 component eventually.

- Should I be using Shape, Sprite, MovieClip for the drawing?

- Do I need to do any double buffering when doing the drawing? Is there support for this in Actionscript? Can I draw to an "offscreen" graphics and then dump the contents of that into the onscreen graphics object?

- Do I need to worry about clipping? Are there mechanisms to allow me to perform clipping? Do I use masks to perform clipping?


My initial attempt is to subclass Canvas and override updateDisplayList to do the drawing. However I'm experiencing two problems with this:

1) It flickers (because I'm doing a graphics.clear() before drawing again).

2) I'm passing around the Canvas' graphics object to draw on. However, lines are appearing outside of the Canvas' bounds which seems a little odd to me. I would have expected automatic clipping to the component's bounds. Is there anyway to achieve that?

Is subclassing Canvas and overriding updateDisplayList the best way to go about things? Or should I be using Shape, Sprite or MovieClip somehow?

Any help much appreciated!

Peter Cowling
09-13-2009, 12:09 PM
Hi,

Check out Birdeye and Axiis. Both open source data viz. projects. The latter being my preferred choice of late.

The graph/visualization will need to respond to updates in the underlying data (a real-time stream of information). It will also be interactive by using the mouse for zooming/panning etc.


The latter is quite possible. The former can quickly hit performance issues.

squisugir
09-14-2009, 10:05 AM
Hi,

Check out Birdeye and Axiis. Both open source data viz. projects. The latter being my preferred choice of late.



The latter is quite possible. The former can quickly hit performance issues.

Great little topic.
And Nice work--thank you for sharing- for me this makes perfect sense though.
Simulation pret immobilier | Taux credit immobilier de France | Calcul de financement par courtier (http://simulationdecreditimmobilier.org)