This ISubtreePlacer splits the children of a local root into clusters based on port groups defined on the edges to the children - the placement of the cluster content and the placement of clusters themselves is delegated to other ISubtreePlacers.
Remarks
The clusters are determined by the port grouping of the edges that connect the children to its root. Port group ids are defined using the TreeLayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> property ports.
The placement of the clusters themselves is specified by a ISubtreePlacer which will consider clustered children like one child node of the local root that this placer is responsible for. The content of the clusters, i.e., the children are placed by another ISubtreePlacer. Both instances are provided in the constructor.
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new MultiSplitSubtreePlacer instance.
Parameters
A map of options to pass to the method.
- clusterPlacer - ISubtreePlacer
- the ISubtreePlacer which places the clusters with respect to the local root node this placer is responsible for, treating each cluster like a node
- childPlacer - ISubtreePlacer
- the ISubtreePlacer which places the children within their cluster. Must not be of type MultiSplitSubtreePlacer.
Throws
- Exception({ name: 'ArgumentError' })
- If one of the given placers is null.
- Exception({ name: 'ArgumentError' })
- If the given
childPlacer
is of type MultiSplitSubtreePlacer
Methods
createProcessor
(treeLayout: TreeLayout, graph: LayoutGraph, currentRoot: LayoutNode) : ISubtreePlacerProcessorCreates an ISubtreePlacerProcessor that prepares the graph for splitting children into multiple clusters based on port grouping.
Remarks
In a pre-processing step, the ISubtreePlacerProcessor inserts a helper node for each port group and connects it to the local root and the edges of the according group. The child subtree placer is assigned to those helper nodes and will arrange them during the layout calculation.
The changes to the graph are restored in a post-processing step.
Parameters
A map of options to pass to the method.
- treeLayout - TreeLayout
- the current TreeLayout instance
- graph - LayoutGraph
- the input graph
- currentRoot - LayoutNode
- the root node handled by this ISubtreePlacer
Returns
- ↪ISubtreePlacerProcessor?
- the ISubtreePlacerProcessor responsible for preparing the graph
Implements
determineChildConnectors
(localRoot: LayoutNode, connectorMap: IMapper<LayoutNode,ParentConnectorDirection>)Delegates to the ISubtreePlacer responsible for arranging the nodes in one cluster.
Parameters
A map of options to pass to the method.
- 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
placeSubtree
(nodeShapeProvider: IMapper<LayoutNode,SubtreeShape>, subtreeShapeProvider: IMapper<LayoutNode,SubtreeShape>, graph: LayoutGraph, localRoot: LayoutNode, parentConnectorDirection: ParentConnectorDirection) : SubtreeShapePlaces the clusters of SubtreeShapes according to their port group ids.
Parameters
A map of options to pass to the method.
- 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
Returns
- ↪SubtreeShape
- The merged SubtreeShapes of the local root and its children