Packageflare.analytics.graph
Classpublic class ShortestPaths
InheritanceShortestPaths Inheritance Operator

Calculates the shortest paths to a source node using Dijkstra's algorithm. Nodes are annotated with both the total distance and their incoming edge along the shortest path.



Public Properties
 PropertyDefined by
  distanceField : String
The property in which to store the link distance.
ShortestPaths
  edgeWeight : Function
A function determining edge weights used in the shortest path calculation.
ShortestPaths
 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.
ShortestPaths
  onpathField : String
The property in which to store a path inclusion flag for edges.
ShortestPaths
 Inheritedparameters : Object
Sets parameter values for this operator.
Operator
  source : NodeSprite
The source node from which to compute the shortest paths.
ShortestPaths
 Inheritedvisualization : Visualization
The visualization processed by this operator.
Operator
Public Methods
 MethodDefined by
  
ShortestPaths(source:NodeSprite = null, edgeWeight:* = null)
Creates a new ShortestPaths operator.
ShortestPaths
 Inherited
applyParameters(op:IOperator, params:Object):void
[static] Static method that applies parameter settings to an operator.
Operator
  
calculate(data:Data, s:NodeSprite, w:Function = null):void
Calculates the shortest paths from a source node.
ShortestPaths
  
ShortestPaths
  
operate(t:Transitioner = null):void
Performs an operation over the contents of a visualization.
ShortestPaths
 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
edgeWeightproperty 
edgeWeight:Function  [read-write]

A function determining edge weights used in the shortest path calculation. When setting this value, one can pass in either a Function, which should take an EdgeSprite as input and return a Number as output, or a String, in which case the string will be used as a property name from which to retrieve the edge weight value from an EdgeSprite instance. If the value is null (the default) all edges will be assumed to have weight 1.

NOTE: Edge weights must be greater than or equal to zero!

Implementation
    public function get edgeWeight():Function
    public function set edgeWeight(value:Function):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
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
sourceproperty 
public var source:NodeSprite

The source node from which to compute the shortest paths.

Constructor detail
ShortestPaths()constructor
public function ShortestPaths(source:NodeSprite = null, edgeWeight:* = null)

Creates a new ShortestPaths operator.

Parameters
source:NodeSprite (default = null) — the source node from which to measure shortest paths
 
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
calculate()method
public function calculate(data:Data, s:NodeSprite, w:Function = null):void

Calculates the shortest paths from a source node.

Parameters
data:Data — the data set containing a graph
 
s:NodeSprite — the source node from which to measure path lengths
 
w:Function (default = null) — a function returning weight values for edges. If null, all edges will be assumed to have equal weight.
getShortestPathTo()method 
public function getShortestPathTo(v:NodeSprite):ArrayParameters
v:NodeSprite

Returns
Array
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.