This class is a IHierarchicLayoutNodePlacer implementation based on rank assignment.
Remarks
Default Values of Properties
barycenterMode | true | |
bendReduction | true | |
exactPlacement | true | |
fromSketchLayerAssignment | true | |
groupCompactionStrategy | NONE
| No group compaction is performed. |
horizontalCompaction | false | |
labelCompaction | false | |
maximumDuration | <code>0x7FFFFFFF</code> | The layout algorithm runs unrestricted. |
minimumSublayerDistance | 15.0d | |
nodeCompaction | false | Nodes are not placed in a compact style. |
straightenEdges | false | A postprocessing step to reduce the number of bends is not applied. |
swimLaneCrossingWeight | 0.0d | The algorithm ignores edges crossing a swimlane border. |
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.SimplexNodePlacer
See Also
Constructors
Creates a new instance of SimplexNodePlacer with the default settings.
Parameters
A map of options to pass to the method.
- nodeCompaction - boolean
Whether or not nodes should be placed in a more compact style with respect to layout width. This option sets the nodeCompaction property on the created object.
- minimumSublayerDistance - number
The minimum distance between the upper and lower sublayer. This option sets the minimumSublayerDistance property on the created object.
- labelCompaction - boolean
Whether or not the SimplexNodePlacer places labels in a more compact style. This option sets the labelCompaction property on the created object.
- bendReduction - boolean
Whether or not an optimization step should be applied that tries to further reduce the number of bends. This option sets the bendReduction property on the created object.
- horizontalCompaction - boolean
Whether or not the SimplexNodePlacer tries to create a maximally compact horizontal layout at the cost of more bends. This option sets the horizontalCompaction property on the created object.
- straightenEdges - boolean
Whether or not a postprocessing step should be applied to reduce the number of bends. This option sets the straightenEdges property on the created object.
- groupCompactionStrategy - GroupCompactionPolicy
The strategy used for controlling the horizontal compactness of group nodes. This option sets the groupCompactionStrategy property on the created object.
- exactPlacement - boolean
Whether or not the SimplexNodePlacer enforces the placement of nodes at their exact current positions, even if this violates minimum distance constraints. This option sets the exactPlacement property on the created object.
- fromSketchLayerAssignment - boolean
Whether or not the SimplexNodePlacer should try to use the coordinates given from the current sketch for the determination of the layer coordinates. This option sets the fromSketchLayerAssignment property on the created object.
- maximumDuration - number
The time limit (in milliseconds) set for the layout algorithm. This option sets the maximumDuration property on the created object.
- swimLaneCrossingWeight - number
The relative weight of edges crossing a swimlane relative to edges that stay in their lane. This option sets the swimLaneCrossingWeight property on the created object.
- barycenterMode - boolean
Whether or not a barycenter drawing mode should be used. This option sets the barycenterMode property on the created object.
- breakLongSegments - boolean
Whether or not the SimplexNodePlacer should break long edge segments in favor of a potentially more compact layout. This option sets the breakLongSegments property on the created object.
Properties
Gets or sets whether or not a barycenter drawing mode should be used.
Remarks
Default Value
true
.See Also
Sample Graphs
Gets or sets whether or not an optimization step should be applied that tries to further reduce the number of bends.
Default Value
true
.See Also
Gets or sets whether or not the SimplexNodePlacer 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 dummy nodes (same x-coordinate). This favors straight edge paths.
- Breaking an edge means that the dummy 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.
Gets or sets whether or not the SimplexNodePlacer enforces the placement of nodes at their exact current positions, even if this violates minimum distance constraints.
Default Value
true
.Gets or sets whether or not the SimplexNodePlacer should try to use the coordinates given from the current sketch for the determination of the layer coordinates.
Default Value
true
.Sample Graphs
Gets or sets the strategy used for controlling the horizontal compactness of group nodes.
Gets or sets whether or not the SimplexNodePlacer tries to create a maximally compact horizontal layout at the cost of more bends.
Remarks
Default Value
false
.See Also
Gets or sets whether or not the SimplexNodePlacer places labels in a more compact style.
Remarks
Default Value
false
.See Also
Gets or sets the time limit (in milliseconds) set for the layout algorithm.
Remarks
0
.Default Value
<code>0x7FFFFFFF</code>
.The layout algorithm runs unrestricted.
Throws
- Exception({ name: 'ArgumentError' })
- if the maximum duration is negative
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
.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.
See Also
Sample Graphs
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.
See Also
Sample Graphs
Gets or sets the relative weight of edges crossing a swimlane relative to edges that stay in their lane.
Remarks
Higher values lead to more compact drawings but may cause additional bends.
Values should lie within [0,1]
interval.
Default Value
0.0d
.The algorithm ignores edges crossing a swimlane border.
Throws
- Exception({ name: 'ArgumentError' })
- if the relative weight does not lie within [0,1]
Sample Graphs
Methods
assignLayerCoordinates
(graph: LayoutGraph, layoutDataProvider: ILayoutDataProvider, layers: ILayers)Assigns preliminary y-coordinates for each layer of a hierarchic layout.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutDataProvider - ILayoutDataProvider
- the ILayoutDataProvider containing information about the elements
- layers - ILayers
- the ILayers instance that will be calculated by this method
Implements
assignNodesToSublayer
(layerNodes: YNodeList, ldp: ILayoutDataProvider, graph: LayoutGraph, lowerSublayer: INodeMap)Assigns the nodes of a given layer to the corresponding upper/lower sublayer if node compaction is enabled.
Remarks
true
for each node that should be placed in the lower sublayer (values are set by this method).Parameters
A map of options to pass to the method.
- layerNodes - YNodeList
- a list of all @link y.layout.hierarchic.incremental.NodeData#TYPE_NORMAL normal nodes} of a layer
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- graph - LayoutGraph
- the given graph
- lowerSublayer - INodeMap
- the INodeMap holding sublayer information
See Also
assignSequenceCoordinates
(graph: LayoutGraph, layoutDataProvider: ILayoutDataProvider, layers: ILayers, drawingDistanceCalculator: IDrawingDistanceCalculator)Determines the resulting x-coordinates of a hierarchic layout.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutDataProvider - ILayoutDataProvider
- the ILayoutDataProvider containing information about the elements
- layers - ILayers
- the ILayers instance that will be calculated by this method
- drawingDistanceCalculator - IDrawingDistanceCalculator
- the given IDrawingDistanceCalculator instance
Implements
getLayerAlignment
(graph: LayoutGraph, ldp: ILayoutDataProvider, node: YNode, layerIndex: number, minLayerHeight: number) : numberReturns the alignment of the node with a specified layer.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- node - YNode
- the given node
- layerIndex - number
- the index of the layer
- minLayerHeight - number
- the minimum height of the layer
Specifies 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 - ILayer
- the layer that contains the nodes
- predNode - YNode
- the node to the left of the other one, may be
null
to indicate a border line - succ - YNode
- 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
Returns the minimum height of a given layer.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the given graph
- ldp - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- layer - ILayer
- the given ILayer object
Returns
- ↪number
- the minimum height
isFixedNode
(graph: LayoutGraph, provider: ILayoutDataProvider, node: YNode, inLayer: boolean) : booleanReturns whether or not the given node should be treated as a node with fixed (given) coordinates.
Remarks
This callback method is used by both assignLayerCoordinates and assignSequenceCoordinates.
If inLayer
argument is true
, this method is called from within the assignLayerCoordinates method.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the given graph
- provider - ILayoutDataProvider
- the ILayoutDataProvider implementation which provides access to the INodeData and IEdgeData instances
- node - YNode
- 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