This class is a ICoordinateAssigner implementation based on simplexRankAssignment.
Remarks
Default Values of Properties
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 | MAX_VALUE
| The layout algorithm runs unrestricted. |
straightenEdges | false | A postprocessing step to reduce the number of bends is not applied. |
symmetryOptimizationStrategy | STRONG
|
Type Details
- yFiles module
- algorithms
Properties
Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends.
Default Value
true
.Property Value
true
if the bend optimization step is applied, false
otherwiseSee Also
Gets or sets whether or not the CoordinateAssigner should break long edge segments in favor of a potentially more compact layout.
Remarks
- Not breaking such edges means that there is a constraint that enforces the alignment of all these bend nodes (same x-coordinate). This favors straight edge paths.
- Breaking an edge means that the bend nodes are not necessarily aligned, but additional bends can be generated if that leads to a horizontally more compact layout result.
Default Value
false
.Long edges will not be broken, in favor of straight edge paths and better performance.
Property Value
true
if long edges are broken, false
otherwiseGets or sets whether or not the CoordinateAssigner enforces the placement of nodes at their exact current positions, even if this violates minimum distance constraints.
Default Value
true
.Property Value
true
if exact coordinates are enforced, false
otherwiseGets 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.
Default Value
true
.Property Value
true
if the current sketch is used, false
otherwiseSample Graphs
Gets or sets whether or not the CoordinateAssigner should improve the horizontal compactness of group nodes.
Default Value
false
.No group compaction is performed.
Property Value
true
if group compaction should be enabled, false
otherwiseGets or sets whether or not the CoordinateAssigner tries to create a maximally compact horizontal layout at the cost of more bends.
Remarks
Default Value
false
.Property Value
true
if a maximally compact horizontal layout is created, false
otherwiseSee Also
Gets or sets whether or not the CoordinateAssigner places labels in a more compact style.
Remarks
Default Value
false
.Property Value
true
if labels are placed compact, false
otherwiseGets or sets the weight of edges crossing a LayoutGrid column/row relative to edges that stay in their lane.
Remarks
Higher values lead to more compact drawings but may cause additional bends.
Values must lie within [0,1]
interval.
- For vertical layout orientations (e.g. TOP_TO_BOTTOM), this affects edges passing the vertical column borders of a LayoutGrid. A higher weight can make the result less wide.
- For horizontal layout orientations (e.g. LEFT_TO_RIGHT), this affects edges passing the horizontal row borders of a LayoutGrid. A higher weight can make the result less high.
Default Value
0.0
.The algorithm ignores edges crossing grid borders.
Property Value
[0,1]
Throws
- Exception({ name: 'ArgumentError' })
- if the relative weight does not lie within [0,1]
Sample Graphs
Gets or sets the minimum distance between the upper and lower sublayer.
Remarks
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
.
Default Value
15.0d
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if minimum sublayer distance is negative
See Also
Sample Graphs
Gets or sets whether or not nodes should be placed in a more compact style with respect to layout width.
Remarks
Default Value
false
.Nodes are not placed in a compact style.
Property Value
true
if nodes are placed in a compact style, false
otherwiseSee Also
Sample Graphs
Gets or sets whether or not to separate layers.
Remarks
Default Value
true
.Layers are separated.
Property Value
true
if layers are separated, false
otherwiseSample Graphs
Gets or sets the time limit set for the layout algorithm.
Remarks
Default Value
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the stop duration is negative
Gets or sets whether or not a postprocessing step should be applied to reduce the number of bends.
Remarks
Default Value
false
.A postprocessing step to reduce the number of bends is not applied.
Property Value
true
if the number of bends is reduced, false
otherwiseSample Graphs
Gets or sets the optimization strategy for the symmetry of the resulting layout.
Default Value
STRONG.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.
Sample Graphs
Methods
Assigns preliminary y-coordinates for each layer of a hierarchical layout.
Remarks
Parameters
A map of options to pass to the method.
- 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.
Implements
assignSequenceCoordinates
(graph: LayoutGraph, layoutContext: HierarchicalLayoutContext, drawingDistanceCalculator: IDrawingDistanceCalculator)Determines the resulting x-coordinates of a hierarchical layout.
Remarks
Parameters
A map of options to pass to the method.
- 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
Implements
getMinimumDistance
(graph: LayoutGraph, layer: HierarchicalLayoutLayer, predNode: LayoutNode, succ: LayoutNode) : numberSpecifies the minimum allowed distance between two nodes of the same given layer.
Remarks
Parameters
A map of options to pass to the method.
- 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
null
to indicate a border line - succ - LayoutNode
- the node to the right of the other one, may be
null
to indicate a border line
Returns
- ↪number
- the minimum distance allowed between those two nodes ( >=0 )
See Also
getMinimumLayerHeight
(graph: LayoutGraph, context: HierarchicalLayoutContext, layer: HierarchicalLayoutLayer) : numberReturns the minimum height of a given layer.
Remarks
Parameters
A map of options to pass to the method.
- 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
Returns
- ↪number
- the minimum height
isFixedNode
(graph: LayoutGraph, layoutContext: HierarchicalLayoutContext, node: LayoutNode, inLayer: boolean) : booleanReturns 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.
Remarks
This callback method is used by both assignLayerCoordinates and assignSequenceCoordinates.
If inLayer
argument is true
, this method is called from within the method assignLayerCoordinates.
Parameters
A map of options to pass to the method.
- 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
true
if the layer coordinate of the node is queried,false
if the sequence coordinate is queried
Returns
- ↪boolean
true
if the node should be treated as fixed,false
otherwise