package flare.vis.data {
import flare.display.DirtySprite;
import flare.util.Colors;
import flare.vis.data.render.IRenderer;
import flare.vis.data.render.ShapeRenderer;
/**
* Base class for display objects that represent visualized data.
* DataSprites support a number of visual properties beyond those provided
* by normal sprites. These include properties for colors, shape, size,
* setting the position in polar coordinates (angle and
* radius), and others.
*
*
The actual appearance of DataSprite instances are determined using
* pluggable renderers that draw graphical content for the sprite. These
* renderers can be changed at runtime to dynamically control appearances.
* Furthermore, since these are sprites, they can contain arbitrary display
* objects as children on the display list, including entire nested
* visualizations.
*
*
DataSprites provides two additional properties worth noting. First,
* the data property references an object containing backing
* data to be visualized. This data object is typically the data record
* (or tuple) this DataSprite visually represents, and its values are often
* used to determined visual encodings. Second, the props
* objects is a dynamic object provided for attaching arbitrary properties
* to a DataSprite instance. For example, some layout algorithms require
* additional parameters on a per-item basis and store these values in the
* props property.
*/
public class DataSprite extends DirtySprite
{
// -- Properties ------------------------------------------------------
/** The renderer for drawing this DataSprite. */
protected var _renderer:IRenderer = ShapeRenderer.instance;
/** Object storing backing data values. */
protected var _data:Object = {};
/** Object for attaching additional properties to this sprite. */
protected var _prop:Object = {};
/** Fixed flag to prevent this sprite from being re-positioned. */
protected var _fixed:int = 0;
/** The fill color for this data sprite. This value is specified as an
* unsigned integer representing an ARGB color. Notice that this
* includes the alpha channel in the color value. */
protected var _fillColor:uint = 0xffcccccc;
/** The line color for this data sprite. This value is specified as an
* unsigned integer representing an ARGB color. Notice that this
* includes the alpha channel in the color value. */
protected var _lineColor:uint = 0xff000000;
/** The line width for this data sprite. */
protected var _lineWidth:Number = 0;
/** Optional object vector of x,y values for specifying arbitrary shapes. */
protected var _points:Vector.