The DoubleLayerSubtreePlacer arranges the subtrees of a local root alternating in two layers.
Implements
Inheritance Hierarchy
Remarks
Layout Style
This ISubtreePlacer arranges nodes from top to bottom. It places the subtrees in two horizontal layers below the root. They are distributed in an alternating fashion, i.e., adjacent subtrees are in different layers.
This subtree placer is especially useful for leaves with a large width.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| layerSpacingRatio | 33 | The distance between the two layers of subtrees is a third of the distance between the root and the upper layer. |
| rootAlignment | SubtreeRootAlignment.TRAILING | |
| spacing | 20 |
See Also
Developer's Guide
Members
No filters for this type
Constructors
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:
falseGets or sets the ratio of the spacing between the root and the children in the upper layer and the spacing between the two layers of subtrees.
Gets or sets the ratio of the spacing between the root and the children in the upper layer and the spacing between the two layers of subtrees.
Negative ratios will lead to node overlaps.
final
Property Value
the ratio to determine the spacing between the two layers of subtrees
Default Value
The default value is: 33
The distance between the two layers of subtrees is a third of the distance between the root and the upper layer.
Sample Graphs
Shown Setting:
0.33Gets or sets the SubtreeRootAlignment that defines how the root node is aligned with its children and their shapes.
Gets or sets the SubtreeRootAlignment that defines how the root node is aligned with its children and their shapes.
conversionfinal
Property Value
the SubtreeRootAlignment value specifying the location relative to the subtrees
Throws
- Exception ({ name: 'ArgumentError' })
- if the given root alignment is
null
Default Value
The default value is: SubtreeRootAlignment.TRAILING
The 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
Methods
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