This class is a ISequencer implementation that performs the second phase of the Sugiyama algorithm.
Implements
- I
Remarks
It minimizes the crossings in the diagram by using either the barycentric or median heuristic.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| randomizationRounds | 50 | The number of randomized rounds is 50, if the stopDuration is limited this value may be automatically reduced to 14. |
| stopDuration | TimeSpan.MAX_VALUE | The algorithm runs unrestricted. |
| transposition | true | The transposition rule is active. |
| weightHeuristic | SequencerWeightHeuristic.BARYCENTER | A barycenter heuristic is used. |
See Also
Developer's Guide
Members
Show:
Constructors
Creates a new instance of DefaultSequencer.
Creates a new instance of DefaultSequencer.
Parameters
Properties
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.
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.
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 otherwiseDefault 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.
Gets or sets the weight heuristic that should be used.
conversionfinal
Property Value
one of the predefined weight heuristics
Default Value
The default value is: SequencerWeightHeuristic.BARYCENTER
A barycenter heuristic is used.
Methods
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.
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.