Packageflare.analytics.graph
Classpublic class LinkDistance
InheritanceLinkDistance Inheritance Operator

Calculates the link distance from a source node based on a breadth-first traversal. Link distance is calculated as the smallest number of edges connecting a node to a source node. Any edge weights are ignored, to include weighted edges in the calculation, use the ShortestPaths operator instead.

Nodes are annotated with both the computed distance and the incoming edge in the shortest link distance path to a source node. Edges are annotated with a Boolean value indicating whether or not the edge lies along one of these computed shortest paths.



Public Properties
 PropertyDefined by
  distanceField : String
The property in which to store the link distance.
LinkDistance
 Inheritedenabled : Boolean
Indicates if the operator is enabled or disabled.
Operator
  incomingField : String
The property in which to store incoming edges along a shortest path.
LinkDistance
  links : int
The link type to consider when calculating link distance.
LinkDistance
  onpathField : String
The property in which to store a path inclusion flag for edges.
LinkDistance
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  sources : Array
The roots of the breadth-first search.
LinkDistance
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Public Methods
 MethodDefined by
  
LinkDistance(sources:Array = null)
Creates a new LinkDistance operator.
LinkDistance
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
  
calculate(data:Data, sources:*):void
Calculates link distances from a set of source nodes for for each node in the graph.
LinkDistance
  
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
LinkDistance
 Inherited
setup():void
Setup method invoked whenever this operator's visualization property is set.
Operator
Property detail
distanceFieldproperty
distanceField:String  [read-write]

The property in which to store the link distance. This property is used to annotate nodes with the minimum link distance to one of the source nodes. The default value is "props.distance".

Implementation
    public function get distanceField():String
    public function set distanceField(value:String):void
incomingFieldproperty 
incomingField:String  [read-write]

The property in which to store incoming edges along a shortest path. This property is used to annotate nodes with the incoming along a shortest path from one of the source nodes. By following sequential incoming edges, one can recreate the shortest path from the nearest source node. The default value is "props.incoming".

Implementation
    public function get incomingField():String
    public function set incomingField(value:String):void
linksproperty 
links:int  [read-write]

The link type to consider when calculating link distance. Should be one of NodeSprite.GRAPH_LINKS, NodeSprite.IN_LINKS, or NodeSprite.OUT_LINKS.

Implementation
    public function get links():int
    public function set links(value:int):void
onpathFieldproperty 
onpathField:String  [read-write]

The property in which to store a path inclusion flag for edges. This property is used to mark edges as belonging to one of the computed shortest paths: true indicates that the edge participates in a shortest path, false indicates that the edge does not lie along a shortest path. The default value is "props.onpath".

Implementation
    public function get onpathField():String
    public function set onpathField(value:String):void
sourcesproperty 
public var sources:Array

The roots of the breadth-first search. The elements of the array should either be NodeSprite instances or integer indices into the node array.

Constructor detail
LinkDistance()constructor
public function LinkDistance(sources:Array = null)

Creates a new LinkDistance operator.

Parameters
sources:Array (default = null) — an Array specifying the roots of the breadth-first search. The elements of the array should either be NodeSprite instances or integer indices into the node array.
Method detail
calculate()method
public function calculate(data:Data, sources:*):void

Calculates link distances from a set of source nodes for for each node in the graph. Each node in the graph will be annotated with its link distance from the nearest source node.

Parameters
data:Data — the graph to calculate distances for
 
sources:* — one or more source nodes from which to measure the distance. This input can either be a single node or an array of nodes. Nodes can be indicated as either a NodeSprite instance or an integer index into the data.nodes property.
operate()method 
public override 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.