C

SubtreeShape

A SubtreeShape represents the position and the borders of a subtree.
Inheritance Hierarchy

Remarks

ISubtreePlacers will move SubtreeShapes and use the borders to calculate distances between the subtrees. When two subtrees are placed in relation to their common root, their SubtreeShapes are merged to represent the new subtree.

The borders on each side of the SubtreeShape are modeled with BorderLines. The resulting area includes the borders of each node and edge in the corresponding subtree. It can also contain the bounds of labels belonging to those nodes and edges.

The SubtreeShape also describes a connector defining the location to which the edge from its parent is attached. It is possible to add some bends (target points) at the end of this edge and include them in the SubtreeShape. During layout calculation, the last target point is the connection point for the edge.

This class cannot be instantiated

See Also

API

getBorderLine, connectorX, connectorY, addBoundsToShape, addTargetPoint

Members

No filters for this type

Properties

Gets the current bounds of this SubtreeShape instance.
readonlyfinal

Property Value

The bounds of the subtree
Gets the direction of the last connector segment.
readonlyfinal

Property Value

one of UP, RIGHT, DOWN or LEFT
Gets the current x-coordinate of the connection point to which the layout algorithm connects the ingoing edge.
The connection point can change when target points are added to the SubtreeShape instance.
readonlyfinal

Property Value

the x-coordinate of the connection point

See Also

API
addTargetPoint, appendTargetPoints
Gets the current y-coordinate of the connection point to which the layout algorithm connects the ingoing edge.
The connection point can change when target points are added to the SubtreeShape instance.
readonlyfinal

Property Value

the y-coordinate of the connection point

See Also

API
addTargetPoint, appendTargetPoints
Gets the bounds of the NodeLayout of the root node of this SubtreeShape instance.
readonlyfinal

Property Value

The bounds of the root node
Gets the current maximum x-coordinate of this SubtreeShape instance.
readonlyfinal

Property Value

The maximum x-coordinate of this SubtreeShape.
Gets the current maximum y-coordinate of this SubtreeShape instance.
readonlyfinal

Property Value

The maximum y-coordinate of this SubtreeShape
Gets the current minimum x-coordinate of this SubtreeShape instance.
readonlyfinal

Property Value

The minimum x-coordinate of this SubtreeShape.
Gets the current minimum y-coordinate of this SubtreeShape instance.
readonlyfinal

Property Value

The minimum y-coordinate of this SubtreeShape.
Gets the current x-coordinate of the origin of this SubtreeShape instance.
The origin is defined as the upper left corner of the NodeLayout of the local root of this shape.
readonlyfinal

Property Value

the x-coordinate of the shape's origin
Gets the current y-coordinate of the origin of this SubtreeShape instance.
The origin is defined as the upper left corner of the NodeLayout of the local root of this shape.
readonlyfinal

Property Value

the y-coordinate of the shape's origin

Methods

Extends this SubtreeShape instance by the given rectangle.
The border lines are updated with this segment.
final

Parameters

bounds: Rect
the bounds that should be added to the shape

See Also

API
getBorderLine
Adds all edge segments of the given edge to this SubtreeShape instance.
The border lines are updated.
final

Parameters

graph: LayoutGraph
the input graph
edge: LayoutEdge
the given edge

See Also

API
getBorderLine, addLineSegment
Extends this SubtreeShape instance by the given segment.
The border lines are updated with this segment.
final

Parameters

x1: number
the x-coordinate of the first point of the segment
y1: number
the y-coordinate of the first point of the segment
x2: number
the x-coordinate of the second point of the segment
y2: number
the y-coordinate of the second point of the segment

See Also

API
getBorderLine, addEdgeSegments, updateConnectorShape
Adds another point to the connector.
The points will appear as bend of the incoming edge. Points are added in reverse direction of the edge. Hence, the last target point is further away from the target node than the points before.
final

Parameters

x: number
the current x-coordinate of the point
y: number
the current y-coordinate of the point
Appends all target points that have previously been added to this shape to the given LayoutEdge instance.
This method is used by ISubtreePlacer instances for the final edge paths.
final

Parameters

edge: LayoutEdge
the LayoutEdge that will be modified

See Also

API
addTargetPoint
Creates a clone of this SubtreeShape instance, modifying it using the provided transformation matrix.
final

Parameters

transform?: SubtreeTransform
The transform that defines the modification for the new instance

Return Value

SubtreeShape
The clone of this SubtreeShape instance
Returns the BorderLine instance that describes the SubtreeShape at the given side.
final

Parameters

side: Side
one of the predefined borderline directions

Return Value

BorderLine
the BorderLine instance for the given side

Throws

Exception ({ name: 'ArgumentError' })
if the given index is invalid
Merges the given SubtreeShape instance with this SubtreeShape instance.
The border lines are updated.
final

Parameters

other: SubtreeShape
the SubtreeShape to be merged with this SubtreeShape
Moves this SubtreeShape instance and its connector by the given offsets.
Border lines are updated.
This is a cheap operation and does not depend on the size or complexity of the shape or connector.
final

Parameters

dx: number
the delta x-offset by which this shape will be moved
dy: number
the delta y-offset by which this shape will be moved
Returns a string representation of the SubtreeShape instance.
final

Return Value

string
A string representation of the SubtreeShape instance.
Adds the line segments of the connector to the bounds of this SubtreeShape instance.
The line segments result from the target points.
final

See Also

API
addTargetPoint