- I
- I
Remarks
Layout Style
The aspect ratio describes the relation between width and height of the subtree. To achieve the desired aspect ratio, this ISubtreePlacer divides the child SubtreeShapes into as much rows as needed. The edges are either routed along the rows or along the columns.
1
0.5
2
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| aspectRatio | 1 | |
| childAlignmentPolicy | AspectRatioChildAlignmentPolicy.LEADING | |
| childArrangement | ChildArrangementPolicy.VERTICAL | The child nodes are placed in vertical columns. |
| horizontalDistance | 40 | |
| rootPlacement | RootPlacementPolicy.CORNER | The root node is placed to the top left of all children. |
| verticalDistance | 40 |
See Also
Developer's Guide
Members
Constructors
Creates a new instance of AspectRatioSubtreePlacer with default settings.
Parameters
Properties
This ratio determines among how many rows/columns the nodes will be distributed.
The aspect ratio needs to be positive.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified aspect ratio is
0or negative
Default Value
Sample Graphs
0.5Gets or sets how children are aligned with each other.
Property Value
Default Value
Gets or sets how the children are arranged.
Property Value
Default Value
Sample Graphs
Gets or sets the horizontal distance between the SubtreeShapes.
The nodes will be placed next to each other, keeping this distance.
The distance needs to be non-negative.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
40During 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
15During 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
15Gets or sets where the root node of the subtree is placed.
Property Value
Default Value
Sample Graphs
Gets or sets the vertical distance between the SubtreeShapes.
The nodes will be placed below each other, keeping this distance.
The distance needs to be non-negative.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
40Methods
Returns a clone of this ISubtreePlacer instance.
Creates an edge comparison function which takes the initial coordinates of the nodes into account.
Return Value
- function(LayoutEdge, LayoutEdge): number
- the comparison function for the edges
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>)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.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