Packageflare.analytics.graph
Classpublic class SpanningTree
InheritanceSpanningTree Inheritance TreeBuilder
ImplementsIOperator

Calculates a spanning tree for a graph structure. This operator can create spanning trees by breadth-first search, depth-first search, or by computing a minimum spanning tree. The default is to find a minimum spanning tree, which in turn defaults to breadth-first search if no edge weight function is provided.

This class can annotate graph edges as belonging to the spanning tree (done if the annotateEdges property is true), and can construct a Tree instance (done if the buildTree property is true). Generated Tree instances are stored in the tree property. Generated trees contain the original nodes and edges in the input graph, and any previous parent or child links for input nodes will be cleared and overwritten.

This class extends the TreeBuilder class to also function as an operator that can be added to a visualization's operator list.



Public Properties
 PropertyDefined by
 InheritedannotateEdges : Boolean
Flag indicating if edges in the spanning tree should be annotated.
TreeBuilder
 InheritedbuildTree : Boolean
Flag indicating if a spanning tree instance should be created.
TreeBuilder
 InheritededgeWeight : Function
A function determining edge weights used in the spanning tree calculation.
TreeBuilder
  enabled : Boolean
Indicates if the operator is enabled or disabled.
SpanningTree
 Inheritedlinks : int
The link type to consider when constructing a spanning tree.
TreeBuilder
  parameters : Object
[write-only] Sets parameter values for this operator.
SpanningTree
 Inheritedpolicy : String
The traveral policy used to generate the spanning tree.
TreeBuilder
 Inheritedroot : NodeSprite
The root node for the spanning tree.
TreeBuilder
 InheritedspanningField : String
The property with which to annotate edges that make up the spanning tree.
TreeBuilder
 Inheritedtree : Tree
The tree created by this operator.
TreeBuilder
  visualization : Visualization
The visualization processed by this operator.
SpanningTree
Public Methods
 MethodDefined by
  
SpanningTree(policy:String = null, buildTree:Boolean = false, annotateEdges:Boolean = true, root:NodeSprite = null, edgeWeight:* = null)
Creates a new SpanningTree operator
SpanningTree
 Inherited
calculate(data:Data, n:NodeSprite):void
Calculates the spanning tree.
TreeBuilder
  
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
SpanningTree
  
setup():void
Setup method invoked whenever this operator's visualization property is set.
SpanningTree
Public Constants
 ConstantDefined by
 InheritedBREADTH_FIRST : String = "breadth-first"
[static] Policy for a spanning tree built using breadth-first search.
TreeBuilder
 InheritedDEPTH_FIRST : String = "depth-first"
[static] Policy for a spanning tree built using depth-first search.
TreeBuilder
 InheritedMINIMUM_SPAN : String = "minimum-span"
[static] Policy for building a minimum spanning tree.
TreeBuilder
Property detail
enabledproperty
enabled:Boolean  [read-write]

Indicates if the operator is enabled or disabled.

Implementation
    public function get enabled():Boolean
    public function set enabled(value:Boolean):void
parametersproperty 
parameters:Object  [write-only]

Sets parameter values for this operator.

Implementation
    public function set parameters(value:Object):void
visualizationproperty 
visualization:Visualization  [read-write]

The visualization processed by this operator.

Implementation
    public function get visualization():Visualization
    public function set visualization(value:Visualization):void
Constructor detail
SpanningTree()constructor
public function SpanningTree(policy:String = null, buildTree:Boolean = false, annotateEdges:Boolean = true, root:NodeSprite = null, edgeWeight:* = null)

Creates a new SpanningTree operator

Parameters
policy:String (default = null) — the spanning tree creation policy. The default is SpanningTree.MINIMUM_SPAN
 
buildTree:Boolean (default = false) — if true, this operator will build a new Tree instance containing the spanning tree
 
annotateEdges:Boolean (default = true) — if true, this operator will annotate the edges of the original graph as belonging to the spanning tree
 
root:NodeSprite (default = null) — the root node from which to compute the spanning tree
 
edgeWeight:* (default = null) — the edge weight values. This can either be a Function that returns weight values or a String providing the name of a property to look up on EdgeSprite instances.
Method detail
operate()method
public function operate(t:Transitioner = null):void

Performs an operation over the contents of a visualization.

Parameters
t:Transitioner (default = null) — a Transitioner instance for collecting value updates.
setup()method 
public function setup():void

Setup method invoked whenever this operator's visualization property is set.