Abstract base class for implementations of the ITreeLayoutNodePlacer interface.
Remarks
This class provides convenience methods for sub-tasks that are often used during the arrangement of a local root and its children. It also offers prepared implementations for the methods of the ITreeLayoutNodePlacer interface.
Subclasses just need to override the following two abstract methods: placeSubtreeOfNode and determineChildConnectors.
Type Details
- yfiles module
- layout-tree
- yfiles-umd modules
- layout-orthogonal-compact, layout-orthogonal, layout-tree, layout
- Legacy UMD name
- yfiles.tree.NodePlacerBase
Constructors
Creates a new instance of NodePlacerBase.
Methods
Returns a clone of this ITreeLayoutNodePlacer instance.
Creates an optional IProcessor for pre- and post-processing.
Remarks
null
. Hence, no pre- or post-processing will be done.Parameters
A map of options to pass to the method.
- layouter - TreeLayout
- the current TreeLayout instance
- graph - LayoutGraph
- the input graph
- currentRoot - YNode
- the root node handled by this ITreeLayoutNodePlacer
Returns
- ↪IProcessor
null
Implements
Determines a connector direction for the given child node.
Remarks
Parameters
A map of options to pass to the method.
- child - YNode
- the child node
Returns
- ↪ParentConnectorDirection
- a direction specifier as defined in the ITreeLayoutNodePlacer interface
Provides the direction of the connector to the SubtreeShape for each child node.
Remarks
Parameters
A map of options to pass to the method.
- localRoot - YNode
- the local root node
- connectorMap - IDataMap
- the map that must be used for storing the direction specifiers of the child nodes
Domain YNode a child node of the local root Values number the direction specifier assigned to the child node
Implements
Returns the SubtreeShape for the given node.
Remarks
This is a convenience method that retrieves a SubtreeShape for a single node from the corresponding IDataProvider.
This method is used in placeSubtreeOfNode for retrieving the SubtreeShapes for the local root nodes. It may be overridden to return a custom implementation of SubtreeShape.
Parameters
A map of options to pass to the method.
- node - YNode
- the node
Returns
- ↪SubtreeShape
- the SubtreeShape for the given node
Returns the SubtreeShape for the subtree rooted at the given node.
Remarks
This is a convenience method that retrieves a SubtreeShape of a complete subtree from the corresponding IDataProvider.
This method is used in placeSubtreeOfNode for retrieving the SubtreeShapes for the subtrees that are arranged. It may be overridden to return a custom implementation of SubtreeShape.
Parameters
A map of options to pass to the method.
- node - YNode
- the local root node
Returns
- ↪SubtreeShape
- the SubtreeShape of the subtree rooted at the given local root node
placeSubtree
(nodeShapeProvider: IDataProvider, subtreeShapeProvider: IDataProvider, graph: LayoutGraph, localRoot: YNode, parentConnectorDirection: ParentConnectorDirection) : SubtreeShapeInitializes the local data structures and then delegates the work to the abstract variant of this method (placeSubtreeOfNode)
Parameters
A map of options to pass to the method.
- nodeShapeProvider - IDataProvider
- the IDataProvider for obtaining an initial shape of the root node
Domain YNode Values SubtreeShape the shape of the node - subtreeShapeProvider - IDataProvider
- the IDataProvider for accessing the pre-calculated shapes of the subtrees
Domain YNode Values SubtreeShape the shape of the subtree rooted at the node - graph - LayoutGraph
- the input graph
- localRoot - YNode
- 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
Returns
- ↪SubtreeShape
- the merged SubtreeShape for the subtree rooted at the local root node
See Also
Implements
placeSubtreeOfNode
(localRoot: YNode, parentConnectorDirection: ParentConnectorDirection) : SubtreeShapeArranges the local root relative to the SubtreeShape of its children.
Remarks
Parameters
A map of options to pass to the method.
- localRoot - YNode
- the local root node
- parentConnectorDirection - ParentConnectorDirection
- the direction of the connector
Returns
- ↪SubtreeShape
- a SubtreeShape instance that describes the shape of the whole subtree rooted at the given local root
Fields
The graph instance this class is working on.