The LeftRightSubtreePlacer arranges the children in a subtree on the left and the right of a vertical bus.
Implements
Inheritance Hierarchy
Remarks
Layout Style
The default settings generate a layout with a single vertical bus, where children are placed left and right of it. By adjusting the branchCount, it is possible to generate multiple vertical buses (i.e. branches) that are placed next to each other, below the root node.Default Values of Properties
| Name | Default | Description |
|---|---|---|
| branchCount | 1 | The layout consists of a single branch. |
| horizontalDistance | 20 | |
| placeLastOnBottom | true | The last child is centered below its siblings |
| spacing | 20 | |
| verticalDistance | 20 |
See Also
Developer's Guide
Members
Show:
Constructors
Creates a new LeftRightSubtreePlacer instance.
Creates a new LeftRightSubtreePlacer instance.
Parameters
Properties
Dependent on the SubtreeRootAlignment type 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 SubtreeRootAlignments:
final
Property Value
true if the ports are to be aligned, false otherwiseDefault Value
The default value is: false
Ports are not aligned.
Sample Graphs
Shown Setting:
falseA branch consists of a vertical bus where the child nodes are placed left and right of it. If the subtree handled by this ISubtreePlacer consists of multiple branches, they are placed next to each other with the root node centered above them. Child nodes are equally distributed over the different available branches. The child/out-edge order is considered such that child subtrees are first assigned to the leftmost branch (e.g. if each branch contains four children, the first four children are in the first, leftmost branch, the second four children are in the second branch and so on).
The assignment of child nodes to the branch is solely based on the out-edge order of the edges from the root of the child nodes. Therefore, if nodes have a user-specified left/right side, the different branches may contain a different number of left and right nodes. By providing a customized child/out-edge order, this can be adjusted to fit more specific requirements.
final
Property Value
the number of branches of the subtree layout
Throws
- Exception ({ name: 'ArgumentError' })
- if the given branch count is smaller than
1
Default Value
The default value is: 1
The layout consists of a single branch.
Sample Graphs
Shown Setting: Layout with a single branch consisting of 12 child nodes
The distance needs to be non-negative.
final
Property Value
the non-negative horizontal distance
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
The default value is: 20
Sample Graphs
Shown Setting:
20During 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.
The specified length only affects the distance from the root node to the first layer of nodes. The distance between the different layers of children are determined by the verticalDistance.
final
Property Value
the non-negative minimum segment length
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum segment length is negative
Default Value
The default value is: 20
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.
The specified length is only considered for the segments to the left and right of the bus. Nodes that are placed centered below the bus ignore this value and consider verticalDistance instead.
final
Property Value
the non-negative minimum segment length
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum segment length is negative
Default Value
The default value is: 20
When enabled, the last child will always be centered independent of the number of siblings.
final
Property Value
true if the last child is separated, false otherwiseDefault Value
The default value is: true
The last child is centered below its siblings
Sample Graphs
Shown Setting:
falseThe spacing needs to be non-negative.
final
Property Value
the distance between subtrees
Throws
- Exception ({ name: 'ArgumentError' })
- if the given spacing is negative
Default Value
The default value is: 20
Sample Graphs
Shown Setting: Spacing
20 using SingleLayerSubtreePlacerGets the modification matrix that defines the direction of the subtree.
Gets the modification matrix that defines the direction of the subtree.
conversionfinal
Property Value
the modification matrix
Default Value
The default value is: SubtreeTransform.NONE
The distance needs to be non-negative.
final
Property Value
the non-negative vertical distance
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
The default value is: 20
Sample Graphs
Shown Setting:
20Methods
Creates an edge comparison which takes the initial coordinates of the nodes into account.
Creates an edge comparison which takes the initial coordinates of the nodes into account.
This comparison defines the order of the outgoing edges of a node before the actual placement of the node's subtree is calculated.
final
Return Value
- function(LayoutEdge, LayoutEdge): number
- the comparison for the edges
Function Details
Encapsulates a method that compares two objects.Parameters- x: LayoutEdge
- The first object to compare.
- y: T
- The second object to compare.
Return Value- number
- An integer value which is
<0ifxis less thany,0ifxis equal toy, or>0ifxis greater thany
final
Parameters
- treeLayout: TreeLayout
- graph: LayoutGraph
- currentRoot: LayoutNode
Return Value
- ISubtreePlacerProcessor | null
determineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)
determineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)final
Parameters
- localRoot: LayoutNode
- connectorMap: IMapper<LayoutNode, ParentConnectorDirection>
final
Parameters
- nodeShapeProvider: IMapper<LayoutNode, SubtreeShape>
- subtreeShapeProvider: IMapper<LayoutNode, SubtreeShape>
- graph: LayoutGraph
- localRoot: LayoutNode
- parentConnectorDirection: ParentConnectorDirection
Return Value
Constants
All constants are filtered. Go to Filters.