- I
- I
Remarks
Layout Style
With its default settings, this placer generates tree layouts with orthogonal edge routes and child nodes that are placed next to each other and below their parent node.
The layout style can be customized in several ways. Subtrees sharing the same local root node are either placed above or below each other.
Features
SubtreeShapes can be arranged in each main direction specified in transformation. That way, the subtrees of the same graph can have different directions.
This subtree placer aligns the local root node according to a chosen alignment.
There are various routing styles that result in different edge routes.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| edgeRoutingStyle | SingleLayerSubtreePlacerRoutingStyle.ORTHOGONAL | |
| minimumChannelSegmentDistance | 0 | |
| rootAlignment | SingleLayerSubtreePlacerRootAlignment.CENTER | |
| verticalAlignment | -1 | Nodes are not aligned. |
See Also
Developer's Guide
Members
Constructors
SingleLayerSubtreePlacer
(verticalDistance?: numberhorizontalDistance?: numberminFirstSegmentLength?: numberminLastSegmentLength?: numberminSlope?: numberminSlopeHeight?: number)Creates a new SingleLayerSubtreePlacer instance.
SingleLayerSubtreePlacer
(Parameters
- transformation?: SubtreeTransform
- The modification matrix that defines the direction of the subtree. Default is NONE.
- rootAlignment?: SingleLayerSubtreePlacerRootAlignment
- The alignment specifier describing how the root node is aligned with its child nodes. Default is CENTER.
- edgeRoutingStyle?: SingleLayerSubtreePlacerRoutingStyle
- The routing style specifier. Default is ORTHOGONAL.
- verticalDistance?: number
- The vertical distance between the SubtreeShapes. Default is
20.0d. - horizontalDistance?: number
- The horizontal distance between the SubtreeShapes. Default is
20.0d. - minFirstSegmentLength?: number
- The minimum length of the first edge segment (connected to the root node). Default is
20.0. - minLastSegmentLength?: number
- The minimum length of the last edge segment (connected to the child node). Default is
20.0. - minSlope?: number
- The minimum slope between the root node and the SubtreeShapes. Default is
0.0. - minSlopeHeight?: number
- The minimum vertical height of sloped edge segments. Default is
0.0.
See Also
Properties
Dependent on the root alignment the subtree root is moved in a way that the edge connecting the root to one of its children is straightened.
This setting only applies to the following rootAlignments:
Property Value
true if the ports are to be aligned, false otherwiseDefault Value
Sample Graphs
falseSee Also
Gets or sets the style in which edge paths are routed.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified routing style is unknown
Default Value
Gets or sets the horizontal distance between nodes or SubtreeShapes.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
40Gets or sets the minimum (non-negative) distance between edge segments that are routed orthogonally in the channel between the root node and the child nodes (see ORTHOGONAL).
0, all segments are routed in a bus-like style.0, minimumSlopeHeight is equal to 0, edgeRoutingStyle is ORTHOGONAL and rootAlignment is not equal to LEADING_ON_BUS or TRAILING_ON_BUS.0 are especially useful if the ITreeLayoutPortAssigner distributes the ports at the nodes' border.Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is smaller than
0
Default Value
Sample Graphs
0 with centered portsDuring layout calculation, the edges of the tree are directed. Hence, the first segment is always the segment that is attached to the source, which is the local root node.
The length needs to be non-negative.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum segment length is negative
Default Value
Sample Graphs
15See Also
Developer's Guide
During layout calculation, the edges of the tree are directed. Hence, the last segment is always the segment that is attached to the target, which is a child node.
The length needs to be non-negative.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum segment length is negative
Default Value
Sample Graphs
15These polyline segments are between the vertical first and last segment of the edge.
The segments may become steeper but they will have at least the specified slope. Negative minimum slopes can lead to edge routes looking like spider legs.
Property Value
Default Value
Sample Graphs
0See Also
These polyline segments are between the vertical first and last segment of the edge.
The segments may become steeper to reach the specified height.
Property Value
Default Value
Sample Graphs
0See Also
API
- minimumSlope
Gets or sets how the root node is aligned with its children and their SubtreeShapes.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if an unknown root alignment specifier is set
Default Value
See Also
Developer's Guide
Gets the modification matrix that defines the direction of the subtree.
Property Value
Default Value
All values between 0 and 1 result in a valid alignment.
0- nodes are top-aligned0.5- nodes are center-aligned1- nodes are bottom-aligned
Values outside the interval [0,1] will result in a more compact node placement with unaligned nodes.
Property Value
Default Value
Sample Graphs
0Gets or sets the vertical distance between nodes or SubtreeShapes.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
40See Also
Developer's Guide
Methods
Returns a clone of this ISubtreePlacer instance.
Creates a comparison for outgoing edges which takes the initial coordinates of the edges' targets into account.
Return Value
- function(LayoutEdge, LayoutEdge): number
- a comparison that considers the initial coordinates of the nodes
Creates an optional ISubtreePlacerProcessor for pre- and post-processing.
null. Hence, no pre- or post-processing will be done.Parameters
- treeLayout: TreeLayout
- the current TreeLayout instance
- graph: LayoutGraph
- the input graph
- currentRoot: LayoutNode
- the root node handled by this ISubtreePlacer
Return Value
Implements
ISubtreePlacer.createProcessordetermineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)Determines the connector direction for each subtree based on the selected transformation applied to the subtree.
determineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)- If the subtree is positioned below the root node (using NONE or FLIP_X), the connector direction will be UP.
- If the subtree is positioned above the root node (using FLIP_Y or ROTATE_180), the connector direction will be DOWN.
- If the subtree is positioned to the left of the root node (using ROTATE_RIGHT or ROTATE_RIGHT_FLIP_Y), the connector direction will be LEFT.
- If the subtree is positioned to the right of the root node (using ROTATE_LEFT or ROTATE_LEFT_FLIP_Y), the connector direction will be RIGHT.
Parameters
- localRoot: LayoutNode
- The local root node for which the connector direction is determined.
- connectorMap: IMapper<LayoutNode, ParentConnectorDirection>
- The IMapper<K, V> used to store the connector direction specifiers for the subtrees.
See Also
Implements
ISubtreePlacer.determineChildConnectorsInitializes the local data structures and then arranges the local root relative to the SubtreeShape of its children.
Parameters
- nodeShapeProvider: IMapper<LayoutNode, SubtreeShape>
- the IMapper<K, V> for obtaining an initial shape of the root node
- subtreeShapeProvider: IMapper<LayoutNode, SubtreeShape>
- the IMapper<K, V> for accessing the pre-calculated shapes of the subtrees
- graph: LayoutGraph
- the input graph
- localRoot: LayoutNode
- the root of the subtree that should be arranged by this method
- parentConnectorDirection: ParentConnectorDirection
- the direction specifier for the connector of the local root node to its parent node
Return Value
- SubtreeShape
- the merged SubtreeShape for the subtree rooted at the local root node