| Package | flare.vis |
| Class | public class Visualization |
| Inheritance | Visualization flash.display.Sprite |
Data instance containing DataSprite
objects that visually represent individual data elementsOperatorList of visualization operators that
determine visual encodings for position, color, size and other
properties.ControlList of interactive controls that enable
interaction with the visualized data.Axes instance for presenting axes for metric
data visualizations. Axes are often configuring automatically by
the visualization's operators.Visual objects are added to the display list within the
marks property of the visualization, as the
Data object is not a DisplayObjectContainer.
All visual elements are contained within layers Sprite.
This includes the axes, marks, and
(optionally) labels layers. Clients who wish to add
additional layers to a visualization should add them directly to the
layers sprite. Just take care to maintain the desired order
of elements to avoid occlusion.
To create a new Visualization, load in a data set, construct
a Data instance, and instantiate a new
Visualization with the input data. Then add the series
of desired operators to the operators property to
define the visual encodings.
See also
| Property | Defined by | ||
|---|---|---|---|
| axes : Axes
The axes for this visualization.
| Visualization | ||
| bounds : Rectangle The layout bounds of the visualization.
| Visualization | ||
| continuousUpdates : Boolean Flag indicating if the visualization should update with every
frame.
| Visualization | ||
| controls : ControlList
[read-only] The control list containing interactive controls.
| Visualization | ||
| data : Data
The visual data elements in this visualization.
| Visualization | ||
| labels : Sprite Sprite containing a separate layer for labels.
| Visualization | ||
| layers : Sprite [read-only] Container sprite holding each layer in the visualization.
| Visualization | ||
| marks : Sprite [read-only] Sprite containing the
DataSprite instances. | Visualization | ||
| operators : OperatorList
[read-only] The operator list for defining the visual encodings.
| Visualization | ||
| props : Object An object storing extra properties for the visualziation.
| Visualization | ||
| tree : Tree
[read-only] Tree structure of visual data elements in this visualization.
| Visualization | ||
| xyAxes : CartesianAxes
[read-only] The axes as an x-y
CartesianAxes instance. | Visualization | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new Visualization with the given data and axes.
| Visualization | ||
|
Retrieves the operator with the given name.
| Visualization | ||
|
removeOperator(name:String):IOperator
Removes a named operator.
| Visualization | ||
|
setAspectRatio(ar:Number, width:Number = -1, height:Number = -1):void
Updates the data display bounds for a visualization based on a
given aspect ratio and provided width and height values.
| Visualization | ||
|
setHitArea(evt:Event = null):void
Creates a sprite covering the bounds for this visualization and
sets it to be this visualization's hit area.
| Visualization | ||
|
Sets a new named operator.
| Visualization | ||
|
update(t:* = null, ... operators):Transitioner
Update this visualization, re-calculating axis layout and running
the operator chain.
| Visualization | ||
|
updateLater(... operators):Function
A function generator that can be used to invoke a visualization
update at a later time.
| Visualization | ||
| Method | Defined by | ||
|---|---|---|---|
|
Data listener invoked when new items are added to this
Visualization's
data instance. | Visualization | ||
|
dataRemoved(evt:DataEvent):void
Data listener invoked when new items are removed from this
Visualization's
data instance. | Visualization | ||
|
fireEvent(type:String, t:Transitioner, params:Array):void
Fires a visualization event of the given type.
| Visualization | ||
| Event | Summary | Defined by | ||
|---|---|---|---|---|
| Visualization | ||||
| axes | property |
axes:Axes [read-write]The axes for this visualization. May be null if no axes are needed.
Implementation public function get axes():Axes
public function set axes(value:Axes):void
| bounds | property |
bounds:Rectangle [read-write]The layout bounds of the visualization. This determines the layout region for data elements. For example, with an axis layout, the bounds determined the data layout region--this does not include space used by axis labels.
Implementation public function get bounds():Rectangle
public function set bounds(value:Rectangle):void
| continuousUpdates | property |
continuousUpdates:Boolean [read-write]Flag indicating if the visualization should update with every frame. False by default.
Implementation public function get continuousUpdates():Boolean
public function set continuousUpdates(value:Boolean):void
| controls | property |
controls:ControlList [read-only]The control list containing interactive controls.
Implementation public function get controls():ControlList
| data | property |
data:Data [read-write]The visual data elements in this visualization.
Implementation public function get data():Data
public function set data(value:Data):void
| labels | property |
labels:Sprite [read-write]Sprite containing a separate layer for labels. Null by default.
Implementation public function get labels():Sprite
public function set labels(value:Sprite):void
| layers | property |
layers:Sprite [read-only]Container sprite holding each layer in the visualization.
Implementation public function get layers():Sprite
| marks | property |
marks:Sprite [read-only] Sprite containing the DataSprite instances.
public function get marks():Sprite
| operators | property |
operators:OperatorList [read-only]The operator list for defining the visual encodings.
Implementation public function get operators():OperatorList
| props | property |
public var props:ObjectAn object storing extra properties for the visualziation.
| tree | property |
tree:Tree [read-only]Tree structure of visual data elements in this visualization. Generates a spanning tree over a graph structure, if necessary.
Implementation public function get tree():Tree
| xyAxes | property |
xyAxes:CartesianAxes [read-only] The axes as an x-y CartesianAxes instance. Returns
null if axes is null or not a cartesian axes instance.
public function get xyAxes():CartesianAxes
| Visualization | () | constructor |
public function Visualization(data:Data = null, axes:Axes = null)Creates a new Visualization with the given data and axes.
Parametersdata:Data (default = null) — the Data instance containing the
DataSprite elements in this visualization.
|
|
axes:Axes (default = null) — the Axes to use with this visualization.
Null by default; layout operators may re-configure the axes.
|
| dataAdded | () | method |
protected function dataAdded(evt:DataEvent):void
Data listener invoked when new items are added to this
Visualization's data instance.
evt:DataEvent — the data event
|
| dataRemoved | () | method |
protected function dataRemoved(evt:DataEvent):void
Data listener invoked when new items are removed from this
Visualization's data instance.
evt:DataEvent — the data event
|
| fireEvent | () | method |
protected function fireEvent(type:String, t:Transitioner, params:Array):voidFires a visualization event of the given type.
Parameterstype:String — the type of the event
|
|
t:Transitioner — a transitioner that listeners should use for any value
updates performed in response to this event
|
|
params:Array |
| operator | () | method |
public function operator(name:String):IOperator
Retrieves the operator with the given name. The name "main" will
return the operator list stored in the operators
property.
name:String — the name of the operator
|
IOperator —
the operator
|
| removeOperator | () | method |
public function removeOperator(name:String):IOperatorRemoves a named operator. An error will be thrown if the caller attempts to remove the operator "main".
Parametersname:String — the name of the operator to remove
|
IOperator —
the removed operator
|
| setAspectRatio | () | method |
public function setAspectRatio(ar:Number, width:Number = -1, height:Number = -1):void
Updates the data display bounds for a visualization based on a
given aspect ratio and provided width and height values. If both
width and height values are provided, they will be treated as the
maximum bounds. If only one of the width or height is provided, then
the width or height will match that value, and the other will be
determined by the aspect ratio. Finally, if neither width nor height
is provided, then the current width and height of the display bounds
will be used as the maximum bounds. After calling this method, a
call to update is necessary to reflect the change.
ar:Number — the desired aspect ratio for the data display
|
|
width:Number (default = -1) — the desired width. If a height value is also provided,
this width value will be treated as the maximum possible width
(the actual width may be lower).
|
|
height:Number (default = -1) — the desired height. If a width value is also provided,
this height value will be treated as the maximum possible height
(the actual height may be lower).
|
| setHitArea | () | method |
public function setHitArea(evt:Event = null):void
Creates a sprite covering the bounds for this visualization and
sets it to be this visualization's hit area. Typically, this
method is triggered in response to a RENDER event.
To disable automatic hit area calculation, use
stage.removeEventListener(Event.RENDER, vis.setHitArea)
after the visualization has been added to the stage.
evt:Event (default = null) — an event that triggered the hit area update
|
| setOperator | () | method |
public function setOperator(name:String, op:IOperator):IOperator
Sets a new named operator. This method can be used to add extra
operators to a visualization, in addition to those in the main
operators property. These operators can be invoked by
passing the operator name as an additional parameter of the
update method. If an operator of the same name
already exists, it will be replaced. Note that the name "main"
refers to the same operator list as the operators
property and can not be replaced.
name:String — the name of the operator to add
|
|
op:IOperator — the operator to add
|
IOperator —
the added operator
|
| update | () | method |
public function update(t:* = null, ... operators):Transitioner
Update this visualization, re-calculating axis layout and running
the operator chain. The input transitioner is used to actually
perform value updates, enabling animated transitions. This method
also issues a VisualizationEvent.UPDATE event to any
registered listeners.
t:* (default = null) — a transitioner or time span for updating object values. If
the input is a transitioner, it will be used to store the updated
values. If the input is a number, a new Transitioner with duration
set to the input value will be used. The input is null by default,
in which case object values are updated immediately.
|
|
... operators — an optional list of named operators to run in the
update.
|
Transitioner —
the transitioner used to store updated values.
|
| updateLater | () | method |
public function updateLater(... operators):Function
A function generator that can be used to invoke a visualization
update at a later time. This method returns a function that
accepts a Transitioner as its sole argument and then
executes a visualization update using the specified named
operators.
... operators — an optional array of named operators to run
|
Function — a function that takes a Transitioner argument
and invokes an update.
|
| update | event |