C

CompactSubtreePlacer

The CompactSubtreePlacer produces a compact placement of the children.
ImplementsInheritance Hierarchy

Remarks

Layout Style

This ISubtreePlacer uses a dynamic optimization approach that chooses a placement strategy of the children of the associated local root such that the overall result is compact with respect to a specified aspect ratio. The set of applied strategies is predefined and cannot be customized. A node can either be a normal tree node or an assistant node, in which case the AssistantSubtreePlacer is chosen automatically (i.e., you shouldn't explicitly map nodes to instances of AssistantSubtreePlacer but mark them with assistantNodes).

All nodes are associated with an instance of CompactSubtreePlacer which yields a compact overall layout using different placement strategies.

Default Values of Properties

NameDefault
horizontalDistance20
preferredAspectRatio1
verticalDistance20

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new CompactSubtreePlacer instance with default settings.

Parameters

Properties

Gets or sets the horizontal distance between nodes or subtrees.
The distance needs to be non-negative.
final

Property Value

the non-negative horizontal distance

Throws

Exception ({ name: 'ArgumentError' })
if the specified distance is negative

Default Value

The default value is: 20

Sample Graphs

ShownSetting: 20
Gets or sets the minimum length for the first segment of an edge.

During layout calculation, the edges of the tree are directed. Hence, the first segment is always the segment that is attached to the source, which is the local root node.

The length needs to be non-negative.

final

Property Value

the non-negative minimum segment length

Throws

Exception ({ name: 'ArgumentError' })
if the minimum segment length is negative

Default Value

The default value is: 20

Sample Graphs

ShownSetting: 15

See Also

Developer's Guide
Gets or sets the minimum length for the last segment of an edge.

During layout calculation, the edges of the tree are directed. Hence, the last segment is always the segment that is attached to the target, which is a child node.

The length needs to be non-negative.

final

Property Value

the non-negative minimum segment length

Throws

Exception ({ name: 'ArgumentError' })
if the minimum segment length is negative

Default Value

The default value is: 20

Sample Graphs

ShownSetting: 15
Gets or sets the preferred aspect ratio (width/height) for the subtrees.
The aspect ratio needs to be non-negative.
The aspect ratio is only considered for nodes associated with a CompactSubtreePlacer and without a parent associated with such a placer.
If the aspect ratio is set to 0, the algorithm automatically chooses one that leads to a small overall area.
final

Property Value

the preferred ratio between width and height

Throws

Exception ({ name: 'ArgumentError' })
if the specified aspect ratio is negative

Default Value

The default value is: 1
Gets or sets the vertical distance between nodes or subtrees.
The distance needs to be non-negative.
final

Property Value

the non-negative vertical distance

Throws

Exception ({ name: 'ArgumentError' })
if the specified distance is negative

Default Value

The default value is: 20

Sample Graphs

ShownSetting: 20

See Also

Developer's Guide

Methods

Returns a clone of this ISubtreePlacer instance.
final

Return Value

any
an exact copy of this ISubtreePlacer instance
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
An ISubtreePlacerProcessor instance or null
Provides the direction of the connector to the SubtreeShape for each child node.
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
Initializes the local data structures and then arranges the local root relative to the SubtreeShape of its children.
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 merged SubtreeShape for the subtree rooted at the local root node

Constants

All constants are filtered. Go to Filters.