- I
Remarks
Layout Style
This ISubtreePlacer uses a dynamic optimization approach that chooses a placement strategy of the children of the associated local root such that the overall result is compact with respect to a specified aspect ratio. The set of applied strategies is predefined and cannot be customized. A node can either be a normal tree node or an assistant node, in which case the AssistantSubtreePlacer is chosen automatically (i.e., you shouldn't explicitly map nodes to instances of AssistantSubtreePlacer but mark them with assistantNodes).
Default Values of Properties
| Name | Default |
|---|---|
| horizontalDistance | 20 |
| preferredAspectRatio | 1 |
| verticalDistance | 20 |
See Also
Developer's Guide
Members
Constructors
Creates a new CompactSubtreePlacer instance with default settings.
Parameters
Properties
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
Sample Graphs
15See Also
Developer's Guide
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
Sample Graphs
150, the algorithm automatically chooses one that leads to a small overall area.Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified aspect ratio is negative
Default Value
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified distance is negative
Default Value
Sample Graphs
20See Also
Developer's Guide
Methods
Returns a clone of this ISubtreePlacer instance.
Creates a ISubtreePlacerProcessor.
Parameters
- treeLayout: TreeLayout
- The current TreeLayout instance
- graph: LayoutGraph
- The input graph
- currentRoot: LayoutNode
- The root node handled by this ISubtreePlacer
Return Value
- ISubtreePlacerProcessor
- An 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.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