- I
- I
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
Constructors
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:
Property Value
true if the ports are to be aligned, false otherwiseDefault Value
Sample Graphs
falseProperty Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the given branch count is smaller than
1
Default Value
Sample Graphs
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
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.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the minimum segment length is negative
Default Value
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
Property Value
true if the last child is separated, false otherwiseDefault Value
Sample Graphs
falseProperty Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the given spacing is negative
Default Value
Sample Graphs
20 using SingleLayerSubtreePlacerGets the modification matrix that defines the direction of the subtree.
Property Value
Default Value
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
20Methods
Creates an edge comparison which takes the initial coordinates of the nodes into account.
Return Value
- function(LayoutEdge, LayoutEdge): number
- the comparison for the edges
Creates an optional ISubtreePlacerProcessor for pre- and post-processing.
null.Parameters
- treeLayout: TreeLayout
- the current TreeLayout instance
- graph: LayoutGraph
- the input graph
- currentRoot: LayoutNode
- the root node handled by this ISubtreePlacer
Return Value
- ISubtreePlacerProcessor
- a ISubtreePlacerProcessor instance or
null
Implements
ISubtreePlacer.createProcessordetermineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)Provides the direction of the connector to the SubtreeShape for each child node.
determineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode, ParentConnectorDirection>)Parameters
- localRoot: LayoutNode
- the local root node
- connectorMap: IMapper<LayoutNode, ParentConnectorDirection>
- the IMapper<K, V> that is used for storing the direction specifiers of the child nodes
Implements
ISubtreePlacer.determineChildConnectorsArranges the SubtreeShapes of the local root and its children and routes the edges that connect them.
This method is the main method of the tree layout algorithm. It is called by TreeLayout in each recursion step to place the local root in relation to its children. Their shapes will be merged into one SubtreeShape, which is returned by this method.
The SubtreeShape for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the SubtreeShapes assigned to the child nodes.
Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this method the SubtreeShape of every descendant node has already been calculated.
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 combined shape of the whole subtree