This class is a ICoordinateAssigner implementation based on simplexRankAssignment.
Implements
- I
Remarks
The algorithm works with integer values and rounds double values to integers using sophisticated quantizing.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| bendReduction | true | |
| fromSketchLayerAssignment | true | |
| groupCompaction | false | No group compaction is performed. |
| horizontalCompaction | false | |
| labelCompaction | false | |
| layoutGridCrossingWeight | 0.0 | The algorithm ignores edges crossing grid borders. |
| minimumSublayerDistance | 15.0d | |
| nodeCompaction | false | Nodes are not placed in a compact style. |
| stopDuration | TimeSpan.MAX_VALUE | The layout algorithm runs unrestricted. |
| straightenEdges | false | A postprocessing step to reduce the number of bends is not applied. |
| symmetryOptimizationStrategy | SymmetryOptimizationStrategy.STRONG |
See Also
Developer's Guide
Members
Show:
Constructors
Properties
Using this option may increase the running time of the layout algorithm. If the running time exceeds the stop duration (see stopDuration) the number of bends is not reduced.
Using symmetryOptimizationStrategy option NONE may further reduce the number of bends.
The optimization is not applied in case that tabular group nodes are defined (see tabularGroups).
final
Property Value
true if the bend optimization step is applied, false otherwiseDefault Value
The default value is: true
See Also
API
- stopDuration
Gets or sets whether or not the CoordinateAssigner should try to use the coordinates given from the current sketch for the determination of the layer coordinates.
Gets or sets whether or not the CoordinateAssigner should try to use the coordinates given from the current sketch for the determination of the layer coordinates.
final
Property Value
true if the current sketch is used, false otherwiseDefault Value
The default value is: true
Sample Graphs
ShownSetting: Initial Graph
Gets or sets whether or not the CoordinateAssigner should improve the horizontal compactness of group nodes.
Gets or sets whether or not the CoordinateAssigner should improve the horizontal compactness of group nodes.
To obtain compact groups you should additionally disable option bendReduction.
final
Property Value
true if group compaction should be enabled, false otherwiseDefault Value
The default value is: false
No group compaction is performed.
Gets or sets whether or not the CoordinateAssigner tries to create a maximally compact horizontal layout at the cost of more bends.
Gets or sets whether or not the CoordinateAssigner tries to create a maximally compact horizontal layout at the cost of more bends.
For best results, breakLongSegments and labelCompaction should also be enabled.
final
Property Value
true if a maximally compact horizontal layout is created, false otherwiseDefault Value
The default value is: false
See Also
Gets or sets whether or not the CoordinateAssigner places labels in a more compact style.
Gets or sets whether or not the CoordinateAssigner places labels in a more compact style.
If this option is enabled, the algorithm tries to place adjacent label elements in a stacked style, i.e., horizontally interleaving.
This option has no effect with customized IDrawingDistanceCalculators, see drawingDistanceCalculator.
final
Property Value
true if labels are placed compact, false otherwiseDefault Value
The default value is: false
A too small distance value may prevent adjacent nodes from being placed in a stacked style (horizontally interleaving) because the vertical distance between these nodes must be greater than or equal to the value specified by minimumDistance.
Values should be greater than 0.
This option is only considered if the node compaction is enabled.
final
Property Value
the minimum distance
Throws
- Exception ({ name: 'ArgumentError' })
- if minimum sublayer distance is negative
Default Value
The default value is: 15.0d
Sample Graphs
ShownSetting: Minimum distance
15.0dSee Also
If enabled, the algorithm may place the nodes of a layer in a stacked style (horizontally interleaving), i.e., it splits the layer into an upper and lower sublayer and places adjacent nodes into different sublayers if this reduces the width of the layer.
Enabling this option increases the required layout height.
Nodes within a tabular group are never placed in a stacked style.
This option does not work with customized IDrawingDistanceCalculators, see drawingDistanceCalculator.
final
Property Value
true if nodes are placed in a compact style, false otherwiseDefault Value
The default value is: false
Nodes are not placed in a compact style.
Sample Graphs
ShownSetting:
falseSee Also
Developer's Guide
API
- minimumSublayerDistance
Gets or sets the time limit set for the layout algorithm.
Gets or sets the time limit set for the layout algorithm.
Values have to be greater than or equal to ZERO.
Restricting the stop duration may result in a lower layout quality. Furthermore, the real runtime may exceed the stop duration since the layout algorithm still has to find a valid solution.
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 layout algorithm runs unrestricted.
Furthermore, enabling this option may violate some minimum distances specified by the user and the edge distribution is no longer uniform.
This option is only considered if option nodeCompaction is disabled.
final
Property Value
true if the number of bends is reduced, false otherwiseDefault Value
The default value is: false
A postprocessing step to reduce the number of bends is not applied.
Sample Graphs
ShownSetting:
falseGets or sets the optimization strategy for the symmetry of the resulting layout.
Gets or sets the optimization strategy for the symmetry of the resulting layout.
Disabling option bendReduction may also produce more symmetric results.
conversionfinal
Property Value
- Strong – Symmetry is prioritized over performance and other layout qualities like compactness.
- Weak – Symmetry is prioritized over performance but not over other layout qualities like compactness.
- None – Symmetry is not prioritized.
Default Value
The default value is: SymmetryOptimizationStrategy.STRONG
Sample Graphs
ShownSetting: NONE
See Also
Developer's Guide
Methods
Assigns preliminary y-coordinates for each layer of a hierarchical layout.
Assigns preliminary y-coordinates for each layer of a hierarchical layout.
The distance between two layers will be adjusted later by the edge routing algorithm. This method is responsible for assigning the relative positions of the nodes within each layer.
Parameters
- graph: LayoutGraph
- The input graph
- layoutContext: HierarchicalLayoutContext
- The HierarchicalLayoutContext containing information about the elements, as well as the layers that will be calculated by this method.
The minimum distance between each pair of nodes of the graph is determined by a IDrawingDistanceCalculator instance.
Parameters
- graph: LayoutGraph
- the input graph
- layoutContext: HierarchicalLayoutContext
- The HierarchicalLayoutContext containing information about the elements, as well as the layers that will be calculated by this method.
- drawingDistanceCalculator: IDrawingDistanceCalculator
- the given IDrawingDistanceCalculator instance
This callback method is used by assignSequenceCoordinates.
protectedfinal
Parameters
- graph: LayoutGraph
- the graph that contains the nodes
- layer: HierarchicalLayoutLayer
- the layer that contains the nodes
- predNode: LayoutNode
- the node to the left of the other one, may be
nullto indicate a border line - succ: LayoutNode
- the node to the right of the other one, may be
nullto indicate a border line
Return Value
- number
- the minimum distance allowed between those two nodes ( >=0 )
See Also
Returns the minimum height of a given layer.
Returns the minimum height of a given layer.
This callback method is used by assignLayerCoordinates.
protected
Parameters
- graph: LayoutGraph
- the given graph
- context: HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
- layer: HierarchicalLayoutLayer
- the layer whose height is calculated
Return Value
- number
- the minimum height
Returns whether or not the given node should be treated as a node with fixed (given) coordinates, that is hint USE_EXACT_LAYER_COORDINATES, USE_EXACT_COORDINATES or USE_EXACT_SEQUENCE_COORDINATES.
Returns whether or not the given node should be treated as a node with fixed (given) coordinates, that is hint USE_EXACT_LAYER_COORDINATES, USE_EXACT_COORDINATES or USE_EXACT_SEQUENCE_COORDINATES.
This callback method is used by both assignLayerCoordinates and assignSequenceCoordinates.
If inLayer argument is true, this method is called from within the method assignLayerCoordinates.
protectedfinal
Parameters
- graph: LayoutGraph
- the given graph
- layoutContext: HierarchicalLayoutContext
- the HierarchicalLayoutContext instance which provides access to the HierarchicalLayoutNodeContext and HierarchicalLayoutEdgeContext instances
- node: LayoutNode
- the given node
- inLayer: boolean
trueif the layer coordinate of the node is queried,falseif the sequence coordinate is queried
Return Value
- boolean
trueif the node should be treated as fixed,falseotherwise