C

SingleSplitSubtreePlacer

SingleSplitSubtreePlacer delegates the arrangement of the children to two different ISubtreePlacers.
Implements
Inheritance Hierarchy

Remarks

Layout Style

This ISubtreePlacer can, for example, be used for creating mind maps or a playing schedule of a sports competition.

There are two subtrees that are placed above and below the root; both subtrees consist of two subtrees that are placed left and right of their local root

Usage

The SingleSplitSubtreePlacer is designed to create two subtree layouts on opposite sides of a common root node. It delegates the arrangement of child nodes to two different ISubtreePlacers, known as the primary and secondary subtree placers. The child nodes are partitioned into primary and secondary sets, either automatically or as defined by the user via TreeLayoutData.singleSplitSubtreePlacerPrimaryNodes<TNode, TEdge, TNodeLabel, TEdgeLabel>. The primary child nodes are arranged as a subtree by the primary subtree placer, with its root positioned at the original root node. Similarly, the secondary child nodes are arranged as a subtree by the secondary subtree placer, also with its root positioned at the original root node. To avoid overlaps between the two subtree layouts, the primary and secondary subtree placers must be configured accordingly. For example, they can be configured such that the subtrees lie on opposite sides.

Examples

Configuration of a single split subtree placer placing the primary subtree and secondray subtree on opposite sides.
const leftLevelAlignedSubtreePlacer = new LevelAlignedSubtreePlacer()
leftLevelAlignedSubtreePlacer.transformation =
  SubtreeTransform.ROTATE_LEFT

const rightLevelAlignedSubtreePlacer = new LevelAlignedSubtreePlacer()
rightLevelAlignedSubtreePlacer.transformation =
  SubtreeTransform.ROTATE_RIGHT

const subtreePlacer = new SingleSplitSubtreePlacer({
  primaryPlacer: leftLevelAlignedSubtreePlacer,
  secondaryPlacer: rightLevelAlignedSubtreePlacer,
})

Members

Show:

Constructors

Creates a new SingleSplitSubtreePlacer instance with default settings using the given subtree placers as delegates.

Parameters

primaryPlacer?: ISubtreePlacer
The primary delegate ISubtreePlacer which places the primary subtree. If omitted, the TreeLayout.defaultSubtreePlacer is used.
secondaryPlacer?: ISubtreePlacer
The secondary delegate ISubtreePlacer which places the right subtrees. If omitted, the TreeLayout.defaultSubtreePlacer is used.

Properties

Gets the ISubtreePlacer instance that will arrange the primary subtree.
readonlyfinal

Property Value

The secondary ISubtreePlacer.
Gets the ISubtreePlacer instance that will arrange the secondary subtree.
readonlyfinal

Property Value

the primary ISubtreePlacer
Gets the modification matrix that defines the direction of the subtree.
conversionfinal

Property Value

the modification matrix

Default Value

The default value is: SubtreeTransform.NONE

Methods

Creates an optional ISubtreePlacerProcessor for pre- and post-processing.
This method is called by TreeLayout before arranging the SubtreeShapes. If no pre- or post-processing is needed, this method may return null.
final

Parameters

treeLayout: TreeLayout
the current TreeLayout instance
graph: LayoutGraph
the input graph
currentRoot: LayoutNode
the root node handled by this ISubtreePlacer

Return Value

final

Parameters

final

Parameters

nodeShapeProvider: IMapper<LayoutNode, SubtreeShape>
subtreeShapeProvider: IMapper<LayoutNode, SubtreeShape>
graph: LayoutGraph
localRoot: LayoutNode
parentConnectorDirection: ParentConnectorDirection

Return Value

Constants

All constants are filtered. Go to Filters.