A LevelAlignedSubtreePlacer arranges the nodes of a subtree into layers such that nodes on the same level/depth are aligned.
Implements
Inheritance Hierarchy
Remarks
Layout Style
Nodes that have the same depth in the tree will be placed in the same horizontal layer. They will be vertically aligned.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| busAlignment | 5 | |
| dendrogramStyle | false | The nodes are assigned to the topmost layer. |
| edgeRoutingStyle | LevelAlignedSubtreePlacerRoutingStyle.STRAIGHT_LINE | |
| layerSpacing | 40 | |
| rootAlignment | SubtreeRootAlignment.TRAILING | |
| spacing | 20 | |
| verticalAlignment | 5 | Nodes are center aligned. |
See Also
Developer's Guide
Members
No filters for this type
Constructors
Creates a new LevelAlignedSubtreePlacer instance.
Creates a new LevelAlignedSubtreePlacer instance.
Parameters
- id?: any
- The ID of this instance, used for identifying LevelAlignedSubtreePlacers that share information about the layer height. Using different IDs allows aligned layouts within different subtrees.
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:
falseThe bus alignment determines the relative position of an edge bus in between two subsequent layers of nodes.
Values for a valid vertical alignment are in the range [0..1], such that:
- A value of
0.0places the bus at the top, right below the parent node. - A value of
0.5places the bus in the middle between parent and child nodes. - A value of
1.0places the bus at the bottom, right above the child nodes.
Bus alignment only applies if the routing style is set to LevelAlignedSubtreePlacerRoutingStyle.ORTHOGONAL.
final
Property Value
the relative bus alignment
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified alignment is outside
[0..1]
Default Value
The default value is: 5
Sample Graphs
Shown Setting:
0.3See Also
Developer's Guide
When enabled, leaves are placed in the same layer and remaining tree nodes are assigned to a layer as close to their children as possible.
final
Property Value
true if the graph is layered as a dendrogram, false otherwiseDefault Value
The default value is: false
The nodes are assigned to the topmost layer.
Sample Graphs
Shown Setting:
falseGets or sets the routing style for the edges in the subtree.
Gets or sets the routing style for the edges in the subtree.
conversionfinal
Property Value
one of the predefined edge routing styles
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified routing style specifier is unknown
Default Value
The default value is: LevelAlignedSubtreePlacerRoutingStyle.STRAIGHT_LINE
The spacing needs to be non-negative.
final
Property Value
the spacing between two layers
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified spacing is negative
Default Value
The default value is: 40
Sample Graphs
Shown Setting:
40See Also
Developer's Guide
If enabled, polyline connectors between the parent and its children are added to the according subtree shape. Node or edge labels will not be crossed.
Polyline labeling only has an effect if the routing style is LevelAlignedSubtreePlacerRoutingStyle.STRAIGHT_LINE.
final
Property Value
true if polyline connectors are added, false otherwiseDefault Value
The default value is: false
Edges are only routed straight.
Sample Graphs
Shown Setting:
falseGets 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 SingleLayerSubtreePlacerSee Also
Developer's Guide
Gets 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
A value of 0 means that nodes are top-aligned; a value of 0.5 means that nodes are center-aligned; a value of 1 means that nodes are bottom-aligned;
Values for a valid vertical alignment are in the range [0..1].
final
Property Value
the vertical alignment of nodes within their layers
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified alignment is outside
[0..1]
Default Value
The default value is: 5
Nodes are center aligned.
Sample Graphs
Shown Setting:
0Methods
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