Packageflare.vis.data
Classpublic class DataSprite
InheritanceDataSprite Inheritance DirtySprite Inheritance flash.display.Sprite
SubclassesEdgeSprite, NodeSprite

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 Properties
 PropertyDefined by
 Inheritedangle : Number
The angle value of this sprite's position in polar co-ordinates.
DirtySprite
  data : Object
Object storing backing data values.
DataSprite
  fillAlpha : Number
The alpha channel (a value between 0 and 1) for the fill color.
DataSprite
  fillColor : uint
The fill color for this data sprite.
DataSprite
  fillHue : Number
The hue component of the fill color in HSV color space.
DataSprite
  fillSaturation : Number
The saturation component of the fill color in HSV color space.
DataSprite
  fillValue : Number
The value (brightness) component of the fill color in HSV color space.
DataSprite
  fixed : Boolean
[read-only] Fixed flag to prevent this sprite from being re-positioned.
DataSprite
  h : Number
Auxiliary property often used as a height parameter.
DataSprite
 Inheritedheight : Number
If dirty, this sprite is re-rendered before returning the height.
DirtySprite
  lineAlpha : Number
The alpha channel (a value between 0 and 1) for the line color.
DataSprite
  lineColor : uint
The line color for this data sprite.
DataSprite
  lineHue : Number
The hue component of the line color in HSV color space.
DataSprite
  lineSaturation : Number
The saturation component of the line color in HSV color space.
DataSprite
  lineValue : Number
The value (brightness) component of the line color in HSV color space.
DataSprite
  lineWidth : Number
The line width for this data sprite.
DataSprite
 Inheritedorigin : Point
The origin point for polar coordinates.
DirtySprite
  points : Array
Optional array of x,y values for specifying arbitrary shapes.
DataSprite
  props : Object
Object for attaching additional properties to this sprite.
DataSprite
 Inheritedradius : Number
The radius value of this sprite's position in polar co-ordinates.
DirtySprite
  renderer : IRenderer
The renderer for drawing this DataSprite.
DataSprite
  shape : String
Name of the shape value of this data sprite.
DataSprite
  size : Number
The size value of this data sprite (1 by default).
DataSprite
  u : Number
Auxiliary property often used as a shape parameter.
DataSprite
  v : Number
Auxiliary property often used as a shape parameter.
DataSprite
  w : Number
Auxiliary property often used as a width parameter.
DataSprite
 Inheritedwidth : Number
If dirty, this sprite is re-rendered before returning the width.
DirtySprite
 Inheritedx : Number
DirtySprite
 Inheritedy : Number
DirtySprite
Protected Properties
 PropertyDefined by
 Inherited_angle : Number
The angle value of this sprite's position in polar co-ordinates.
DirtySprite
  _data : Object
Object storing backing data values.
DataSprite
  _fillColor : uint = 0xffcccccc
The fill color for this data sprite.
DataSprite
  _fixed : int = 0
Fixed flag to prevent this sprite from being re-positioned.
DataSprite
  _h : Number = 0
Auxiliary property often used as a height parameter.
DataSprite
  _lineColor : uint = 0xff000000
The line color for this data sprite.
DataSprite
  _lineWidth : Number = 0
The line width for this data sprite.
DataSprite
 Inherited_origin : Point
The origin point for polar coordinates.
DirtySprite
  _points : Array
Optional array of x,y values for specifying arbitrary shapes.
DataSprite
  _prop : Object
Object for attaching additional properties to this sprite.
DataSprite
 Inherited_radius : Number
The radius value of this sprite's position in polar co-ordinates.
DirtySprite
  _renderer : IRenderer
The renderer for drawing this DataSprite.
DataSprite
  _shape : String = "circle"
Code indicating the shape value of this data sprite.
DataSprite
  _size : Number = 1
The size value of this data sprite (1 by default).
DataSprite
  _u : Number = 0
Auxiliary property often used as a shape parameter.
DataSprite
  _v : Number = 0
Auxiliary property often used as a shape parameter.
DataSprite
  _w : Number = 0
Auxiliary property often used as a width parameter.
DataSprite
Public Methods
 MethodDefined by
  
Creates a new DataSprite.
DataSprite
 Inherited
dirty():void
Marks this sprite as "dirty" and in need of re-rendering.
DirtySprite
  
fix(num:uint = 1):void
Increments the fixed counter.
DataSprite
 Inherited
getBounds(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered returning the bounds.
DirtySprite
 Inherited
getRect(targetCoordinateSpace:DisplayObject):Rectangle
If dirty, this sprite is re-rendered before returning the rect.
DirtySprite
 Inherited
hitTestObject(obj:DisplayObject):Boolean
If dirty, either sprite is re-rendered before hit-testing.
DirtySprite
 Inherited
hitTestPoint(x:Number, y:Number, shapeFlag:Boolean = false):Boolean
If dirty, this sprite is re-rendered before hit-testing.
DirtySprite
  
render():void
Draw this sprite's graphical content.
DataSprite
 Inherited
renderDirty(evt:Event = null):void
[static] Frame render callback that renders all sprites on the dirty list.
DirtySprite
 Inherited
toString():String
DirtySprite
  
unfix(num:uint = 1):void
Decrements the fixed counter.
DataSprite
Public Constants
 ConstantDefined by
 InheritedZERO : Point
[static] A constant for the point (0,0).
DirtySprite
Property detail
_dataproperty
protected var _data:Object

Object storing backing data values.

dataproperty 
data:Object  [read-write]

Object storing backing data values.

Implementation
    public function get data():Object
    public function set data(value:Object):void
fillAlphaproperty 
fillAlpha:Number  [read-write]

The alpha channel (a value between 0 and 1) for the fill color.

Implementation
    public function get fillAlpha():Number
    public function set fillAlpha(value:Number):void
_fillColorproperty 
protected var _fillColor:uint = 0xffcccccc

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.

fillColorproperty 
fillColor:uint  [read-write]

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.

Implementation
    public function get fillColor():uint
    public function set fillColor(value:uint):void
fillHueproperty 
fillHue:Number  [read-write]

The hue component of the fill color in HSV color space.

Implementation
    public function get fillHue():Number
    public function set fillHue(value:Number):void
fillSaturationproperty 
fillSaturation:Number  [read-write]

The saturation component of the fill color in HSV color space.

Implementation
    public function get fillSaturation():Number
    public function set fillSaturation(value:Number):void
fillValueproperty 
fillValue:Number  [read-write]

The value (brightness) component of the fill color in HSV color space.

Implementation
    public function get fillValue():Number
    public function set fillValue(value:Number):void
_fixedproperty 
protected var _fixed:int = 0

Fixed flag to prevent this sprite from being re-positioned.

fixedproperty 
fixed:Boolean  [read-only]

Fixed flag to prevent this sprite from being re-positioned.

Implementation
    public function get fixed():Boolean
_hproperty 
protected var _h:Number = 0

Auxiliary property often used as a height parameter.

hproperty 
h:Number  [read-write]

Auxiliary property often used as a height parameter.

Implementation
    public function get h():Number
    public function set h(value:Number):void
lineAlphaproperty 
lineAlpha:Number  [read-write]

The alpha channel (a value between 0 and 1) for the line color.

Implementation
    public function get lineAlpha():Number
    public function set lineAlpha(value:Number):void
_lineColorproperty 
protected var _lineColor:uint = 0xff000000

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.

lineColorproperty 
lineColor:uint  [read-write]

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.

Implementation
    public function get lineColor():uint
    public function set lineColor(value:uint):void
lineHueproperty 
lineHue:Number  [read-write]

The hue component of the line color in HSV color space.

Implementation
    public function get lineHue():Number
    public function set lineHue(value:Number):void
lineSaturationproperty 
lineSaturation:Number  [read-write]

The saturation component of the line color in HSV color space.

Implementation
    public function get lineSaturation():Number
    public function set lineSaturation(value:Number):void
lineValueproperty 
lineValue:Number  [read-write]

The value (brightness) component of the line color in HSV color space.

Implementation
    public function get lineValue():Number
    public function set lineValue(value:Number):void
_lineWidthproperty 
protected var _lineWidth:Number = 0

The line width for this data sprite.

lineWidthproperty 
lineWidth:Number  [read-write]

The line width for this data sprite.

Implementation
    public function get lineWidth():Number
    public function set lineWidth(value:Number):void
_pointsproperty 
protected var _points:Array

Optional array of x,y values for specifying arbitrary shapes.

pointsproperty 
points:Array  [read-write]

Optional array of x,y values for specifying arbitrary shapes.

Implementation
    public function get points():Array
    public function set points(value:Array):void
_propproperty 
protected var _prop:Object

Object for attaching additional properties to this sprite.

propsproperty 
props:Object  [read-write]

Object for attaching additional properties to this sprite.

Implementation
    public function get props():Object
    public function set props(value:Object):void
_rendererproperty 
protected var _renderer:IRenderer

The renderer for drawing this DataSprite.

rendererproperty 
renderer:IRenderer  [read-write]

The renderer for drawing this DataSprite.

Implementation
    public function get renderer():IRenderer
    public function set renderer(value:IRenderer):void
_shapeproperty 
protected var _shape:String = "circle"

Code indicating the shape value of this data sprite.

shapeproperty 
shape:String  [read-write]

Name of the shape value of this data sprite.

Implementation
    public function get shape():String
    public function set shape(value:String):void

See also

flare.vis.util.Shapes
_sizeproperty 
protected var _size:Number = 1

The size value of this data sprite (1 by default).

sizeproperty 
size:Number  [read-write]

The size value of this data sprite (1 by default).

Implementation
    public function get size():Number
    public function set size(value:Number):void
_uproperty 
protected var _u:Number = 0

Auxiliary property often used as a shape parameter.

uproperty 
u:Number  [read-write]

Auxiliary property often used as a shape parameter.

Implementation
    public function get u():Number
    public function set u(value:Number):void
_vproperty 
protected var _v:Number = 0

Auxiliary property often used as a shape parameter.

vproperty 
v:Number  [read-write]

Auxiliary property often used as a shape parameter.

Implementation
    public function get v():Number
    public function set v(value:Number):void
_wproperty 
protected var _w:Number = 0

Auxiliary property often used as a width parameter.

wproperty 
w:Number  [read-write]

Auxiliary property often used as a width parameter.

Implementation
    public function get w():Number
    public function set w(value:Number):void
Constructor detail
DataSprite()constructor
public function DataSprite()

Creates a new DataSprite.

Method detail
fix()method
public function fix(num:uint = 1):void

Increments the fixed counter. If the fixed counter is greater than zero, the data sprite should be fixed. A counter is used so that if different components both adjust the fixed settings, they won't overwrite each other.

Parameters
num:uint (default = 1) — the amount to increment the counter by (default 1)
render()method 
public override function render():void

Draw this sprite's graphical content. Subclasses should override this method with custom drawing code.

unfix()method 
public function unfix(num:uint = 1):void

Decrements the fixed counter. If the fixed counter is greater than zero, the data sprite should be fixed. A counter is used so that if different components both adjust the fixed settings, they won't overwrite each other. This method does not allow the fixed counter to go below zero.

Parameters
num:uint (default = 1) — the amount to decrement the counter by (default 1)