C

DefaultSequencer

This class is a ISequencer implementation that performs the second phase of the Sugiyama algorithm.
ImplementsInheritance Hierarchy

Remarks

It minimizes the crossings in the diagram by using either the barycentric or median heuristic.

Default Values of Properties

NameDefaultDescription
randomizationRounds50
The number of randomized rounds is 50, if the stopDuration is limited this value may be automatically reduced to 14.
stopDurationTimeSpan.MAX_VALUE
The algorithm runs unrestricted.
transpositiontrue
The transposition rule is active.
weightHeuristicSequencerWeightHeuristic.BARYCENTER
A barycenter heuristic is used.

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new instance of DefaultSequencer.

Parameters

Properties

Gets or sets the number of randomized rounds that this algorithm performs, if there was no optimal solution.
Values have to be greater than or equal to 0.
final

Property Value

the number of additional rounds

Throws

Exception ({ name: 'ArgumentError' })
if a negative value is given

Default Value

The default value is: 50
The number of randomized rounds is 50, if the stopDuration is limited this value may be automatically reduced to 14.
Gets or sets the time limit set for this sequencer per execution.
Values have to be greater than or equal to ZERO.
conversionfinal

Property Value

a non-negative value that specifies the time limit

Throws

Exception ({ name: 'ArgumentError' })
if the stop duration is negative.

Default Value

The default value is: TimeSpan.MAX_VALUE
The algorithm runs unrestricted.
Gets or sets whether to apply an additional crossing minimization heuristic.
Activating this heuristic can reduce the overall number of edge crossings. On the other hand, it may increase the running time.
final

Property Value

true if the crossing minimization heuristic is applied, false otherwise

Default Value

The default value is: true
The transposition rule is active.

Sample Graphs

ShownSetting: Transposition disabled - five crossings
Gets or sets the weight heuristic that should be used.
conversionfinal

Property Value

one of the predefined weight heuristics

Default Value

A barycenter heuristic is used.

Methods

Returns the cost of an edge crossing between the two given edges.

The default implementation defines the crossing cost of two edges as the product of the individual crossing costs which are defined with edgeCrossingCosts. If no individual crossing costs are defined, all edges have a cost of 1, hence, this method also returns 1.

This method may be overridden to specify costs for a specific pair of edges. The given HierarchicalLayoutContext is helpful to determine the type of the edges by using method getEdgeContext. Furthermore, using the original edge to decide what a crossing costs might be helpful, see getOriginalEdge.

protected

Parameters

edge1: LayoutEdge
the first edge involved in the crossing
edge2: LayoutEdge
the second edge involved in the crossing
layoutContext: HierarchicalLayoutContext
the HierarchicalLayoutContext containing information about the edges and nodes

Return Value

number
the crossing cost for the two given edges
Calculates the sequence of the nodes within each layer of the layers list in the given layoutContext.
This method is called by HierarchicalLayoutCore during the second phase and finally writes back the calculated sequence using the setNodeOrder method.

Parameters

graph: LayoutGraph
the input graph
layoutContext: HierarchicalLayoutContext
The HierarchicalLayoutContext instance which provides access to context information about the nodes and edges of the graph, as well as the ItemFactory used temporarily for modifying the graph instance.