C

MultiLayerSubtreePlacer

The MultiLayerSubtreePlacer arranges the children/subtrees of a local root into multiple layers.

Remarks

Layout Style

The children/subtrees are assigned to the layers with TreeLayoutData.multiLayerSubtreePlacerLayerIndices<TNode, TEdge, TNodeLabel, TEdgeLabel>. If there is no layer mapping provided, the layer assignment is made automatically - the produced structure will be square-like with respect to the child count, ignoring actual subtree sizes. For example, if there are nine children, a structure with three layers each containing three nodes is generated.

The edges from the children to the local root are routed in a bus-like style. The placement of the bus can be configured using the property busPlacement. The alignment of the root node can be configured using rootAlignment. To align the root node with the bus, use MultiLayerSubtreePlacerRootAlignment.BUS_ALIGNED. A bus-aligned root in conjunction with BusPlacement.CENTER produces a symmetric multi-layer structure with the bus and root aligned in the middle.

Child nodes are assigned to three layers with a bus-aligned root and the bus placed in the center

Child nodes are assigned to three layers where the root alignment and bus placement are "leading".

Default Values of Properties

NameDefaultDescription
busPlacementBusPlacement.LEADING
The bus is placed leading, left of the child nodes.
rootAlignmentMultiLayerSubtreePlacerRootAlignment.BUS_ALIGNED
spacing20

Members

Show:

Constructors

Creates a new MultiLayerSubtreePlacer instance.

Parameters

rootAlignment?: MultiLayerSubtreePlacerRootAlignment
conversion
The alignment of the local root with its subtrees (optional). The default value is MultiLayerSubtreePlacerRootAlignment.BUS_ALIGNED.

Properties

Gets or sets the placement of the bus with respect to the child nodes.
conversionfinal

Property Value

one of the predefined bus placements

Throws

Exception ({ name: 'ArgumentError' })
if the given bus placement is unknown

Default Value

The default value is: BusPlacement.LEADING
The bus is placed leading, left of the child nodes.
Gets or sets the MultiLayerSubtreePlacerRootAlignment that defines how the root node is aligned with its children and their shapes.
conversionfinal

Property Value

The MultiLayerSubtreePlacerRootAlignment value specifying the location relative to the subtrees.

Default Value

Gets or sets the spacing between subtrees.
The spacing needs to be non-negative.
final

Property Value

the distance between subtrees

Throws

Exception ({ name: 'ArgumentError' })
if the given spacing is negative

Default Value

The default value is: 20

Sample Graphs

Shown Setting: Spacing 20 using SingleLayerSubtreePlacer
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 a comparison that sorts the outgoing edges according to the rows and x-coordinates of their target nodes.
Edges that connect to nodes in different rows are ordered by the row index. If two edges connect to the same row, they are sorted by the x-coordinates of their target nodes.
If no layer indices are defined via TreeLayoutData.multiLayerSubtreePlacerLayerIndices<TNode, TEdge, TNodeLabel, TEdgeLabel>, the rows are automatically assigned, and the created from-sketch comparison does not have an effect.
final

Return Value

function(LayoutEdge, LayoutEdge): number
a comparison that orders edges lexicographically by row and x-coordinates of their target nodes
Function Details
Encapsulates a method that compares two objects.
Parameters
x: LayoutEdge
The first object to compare.
y: T
The second object to compare.
Return Value
number
An integer value which is <0 if x is less than y, 0 if x is equal to y, or >0 if x is greater than y
final

Parameters

treeLayout: TreeLayout
graph: LayoutGraph
currentRoot: LayoutNode

Return Value

final

Parameters

localRoot: LayoutNode
connectorMap: IMapper<LayoutNode, ParentConnectorDirection>
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.