Packageflare.vis.operator.layout
Classpublic class CirclePackingLayout
InheritanceCirclePackingLayout Inheritance Layout Inheritance Operator

Layout that places nodes as circles compacted into a larger circle.

Circle sizes are determined by a node's size property. It is assumed that the sizes are set before this operator is run, for example, by placing a SizeEncoder prior to this layout in an operator list.

If the treeLayout property is false, all nodes will be treated the same and the result will be a "bubble" chart. If the treeLayout property is true, circles will be nested inside each other according to the tree structure of the data.

The results of this layout can vary dramatically based on the sort order of the nodes. For example, sorting the nodes by the size property (in either ascending or descending order) can result in much cleaner layouts. Use the sort property of this class to set a preferred sorting routine. By default, this operator will not perform any sorting.

NOTE: This operator will set a node's renderer and shape properties, overriding any previous values.

The algorithm used to perform the circle packing is adapted from W. Wang, H. Wang, G. Dai, and H. Wang's Visualization of large hierarchical data by circle packing, ACM CHI 2006.



Public Properties
 PropertyDefined by
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
  fitInBounds : Boolean = true
Indicates if the view should be scaled to fit within the display bounds.
CirclePackingLayout
  group : String = "nodes"
The data group to process.
CirclePackingLayout
 InheritedlayoutAnchor : Point
The layout anchor, used by some layout instances to place an initial item or determine a focal point.
Layout
 InheritedlayoutBounds : Rectangle
The layout bounds for the layout.
Layout
 InheritedlayoutRoot : DataSprite
The layout root, the root node for tree layouts.
Layout
 InheritedlayoutType : String = "null"
The type of layout and axes.
Layout
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  sort : Sort
A sort criteria for ordering nodes in this layout.
CirclePackingLayout
  spacing : Number = 4
The amount of spacing between neighboring circles.
CirclePackingLayout
  treeLayout : Boolean = false
Indicates if a tree layout (circles nested within circles) should be computed.
CirclePackingLayout
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Protected Properties
 PropertyDefined by
 Inherited_anchor : Point
Layout
 Inherited_setAnchor : Boolean = false
Layout
 Inherited_t : Transitioner = null
A transitioner for storing value updates.
Layout
 InheritedxyAxes : CartesianAxes
Returns the visualization's axes as a CartesianAxes instance.
Layout
Public Methods
 MethodDefined by
  
CirclePackingLayout(spacing:Number = 4, treeLayout:Boolean = false, sort:* = null)
Creates a new CirclePackingLayout.
CirclePackingLayout
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
 Inherited
Strips all EdgeSprites in a visualization of any control points.
Layout
 Inherited
Hides the axes.
Layout
 Inherited
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
Layout
 Inherited
setup():void
Setup method invoked whenever this operator's visualization property is set.
Operator
 Inherited
Reveals the axes.
Layout
 Inherited
[static] Updates all edges to be straight lines.
Layout
Protected Methods
 MethodDefined by
 Inherited
autoAnchor():void
Automatically-generate an anchor point.
Layout
  
layout():void
Calculates the spatial layout of visualized items.
CirclePackingLayout
 Inherited
minAngle(a1:Number, a2:Number):Number
Returns an angle value that minimizes the angular distance between a reference angle and a target angle.
Layout
Public Constants
 ConstantDefined by
 InheritedCARTESIAN : String = "cartesian"
[static] Constant indicating Cartesian (x, y) coordinates.
Layout
 InheritedPOLAR : String = "polar"
[static] Constant indicating polar (radius, angle) coordinates.
Layout
Property detail
fitInBoundsproperty
public var fitInBounds:Boolean = true

Indicates if the view should be scaled to fit within the display bounds. The default is true.

groupproperty 
public var group:String = "nodes"

The data group to process. This setting will be ignored if tree mode is set to true.

sortproperty 
sort:Sort  [read-write]

A sort criteria for ordering nodes in this layout. Ordered nodes are placed in a spiral starting at the center. The default is null, meaning no sorting is performed.

Implementation
    public function get sort():Sort
    public function set sort(value:Sort):void
spacingproperty 
public var spacing:Number = 4

The amount of spacing between neighboring circles. The default value is 4 pixels.

treeLayoutproperty 
public var treeLayout:Boolean = false

Indicates if a tree layout (circles nested within circles) should be computed. The default is false. Any data group settings will be ignored if this operator uses a tree layout.

Constructor detail
CirclePackingLayout()constructor
public function CirclePackingLayout(spacing:Number = 4, treeLayout:Boolean = false, sort:* = null)

Creates a new CirclePackingLayout.

Parameters
spacing:Number (default = 4) — the minimum spacing between neighboring circles
 
treeLayout:Boolean (default = false) — if true, a hierarchical circles-within-circles layout will be peformed; if false (the default) all nodes will be considered equally
 
sort:* (default = null) — a sort criteria for ordering nodes in the layout. Ordered nodes are placed in a spiral starting at the center.
Method detail
layout()method
protected override function layout():void

Calculates the spatial layout of visualized items. Layout operators override this method with their layout implementations.