C

AssistantSubtreePlacer

The AssistantSubtreePlacer places nodes that are marked as assistants left and right of their parents and all other nodes below the assistant nodes.

Remarks

Layout Style

Assistants are marked

Concept

This ISubtreePlacer delegates the placement of all assistant nodes to an instance of LeftRightSubtreePlacer. The non-assistant nodes are handled by another subtree placer. To be able to do this, AssistantSubtreePlacer uses an ISubtreePlacerProcessor which prepares the graph for node placing.

Nodes can be defined as assistant nodes with assistantNodes.

Default Values of Properties

NameDefaultDescription
childSubtreePlacerSingleLayerSubtreePlacer
A SingleLayerSubtreePlacer with median root alignment, orthogonal edge routing style, and no transformation matrix applied.
spacing20

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new AssistantSubtreePlacer instance.

Parameters

Properties

Gets or sets the ISubtreePlacer instance that places the non-assistant children.
These non-assistant child nodes will be placed below the assistant child nodes and are arranged by the given ISubtreePlacer. Non-assistant child nodes are the ones that are not defined with assistantNodes.
Using CompactSubtreePlacer as placer for non-assistant children is not supported. Instead, CompactSubtreePlacer itself allows to define assistant nodes and in that case places subtrees using the same style as AssistantSubtreePlacer does.
final

Property Value

the child subtree placer for the non-assistant children

Throws

Exception ({ name: 'ArgumentError' })
if the given child placer is null or an instance of class CompactSubtreePlacer.

Default Value

The default value is: SingleLayerSubtreePlacer
A SingleLayerSubtreePlacer with median root alignment, orthogonal edge routing style, and no transformation matrix applied.

See Also

Developer's Guide
API
assistantNodes
Gets or sets the spacing between subtrees for the delegate ISubtreePlacer.
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

ShownSetting: 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 an edge comparison which takes the initial coordinates of the nodes into account.

This comparison defines the order of the outgoing edges of a node before the actual placement of the node's subtree is calculated.

The from-sketch comparison functions of the LeftRightSubtreePlacer and childSubtreePlacer are combined into a compound function.

final

Return Value

function(LayoutEdge, LayoutEdge): number
the comparison for the edges
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

ISubtreePlacerProcessor
a ISubtreePlacerProcessor instance or null
Provides the direction of the connector to the SubtreeShape for each child node.
This method is called by TreeLayout before the SubtreeShapes for the children of the local root node are calculated. The direction specifiers are stored in the given map for all child nodes of the local root.
final

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
Arranges the SubtreeShapes of the local root and its children and routes the edges that connect them.

This method is the main method of the tree layout algorithm. It is called by TreeLayout in each recursion step to place the local root in relation to its children. Their shapes will be merged into one SubtreeShape, which is returned by this method.

The SubtreeShape for the local root can be obtained from the nodeShapeProvider. subtreeShapeProvider contains the SubtreeShapes assigned to the child nodes.

Due to the order in which the tree nodes are processed, it is guaranteed that at the time of the invocation of this method the SubtreeShape of every descendant node has already been calculated.

final

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 combined shape of the whole subtree

Constants

All constants are filtered. Go to Filters.