A SubtreeShape represents the position and the borders of a subtree.
Remarks
ITreeLayoutNodePlacers 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.
Type Details
- yfiles module
- layout-tree
- yfiles-umd modules
- layout-orthogonal-compact, layout-orthogonal, layout-tree, layout
- Legacy UMD name
- yfiles.tree.SubtreeShape
See Also
Properties
Gets the current bounds of this SubtreeShape instance.
Gets the direction of the last connector segment.
Gets the current x-coordinate of the connection point to which the layout algorithm connects the ingoing edge.
Remarks
See Also
Gets the current y-coordinate of the connection point to which the layout algorithm connects the ingoing edge.
Remarks
See Also
Gets the bounds of the INodeLayout of the root node of this SubtreeShape instance.
Gets the current maximum x-coordinate of this SubtreeShape instance.
Gets the current maximum y-coordinate of this SubtreeShape instance.
Gets the current minimum x-coordinate of this SubtreeShape instance.
Gets the current minimum y-coordinate of this SubtreeShape instance.
Gets the current x-coordinate of the origin of this SubtreeShape instance.
Remarks
Gets the current y-coordinate of the origin of this SubtreeShape instance.
Remarks
Methods
Extends this SubtreeShape instance by the given rectangle.
Remarks
Parameters
A map of options to pass to the method.
- x - number
- the x-coordinate of the upper-left corner of the rectangle
- y - number
- the y-coordinate of the upper-left corner of the rectangle
- width - number
- the width of the rectangle
- height - number
- the height of the rectangle
See Also
Adds all edge segments of the given edge to this SubtreeShape instance.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- edge - Edge
- the given edge
See Also
Extends this SubtreeShape instance by the given segment.
Remarks
Parameters
A map of options to pass to the method.
- 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
Adds another point to the connector.
Remarks
Parameters
A map of options to pass to the method.
- 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 IEdgeLayout instance.
Remarks
Parameters
A map of options to pass to the method.
- edgeLayout - IEdgeLayout
- the IEdgeLayout that will be modified
See Also
Copies the state of this SubtreeShape instance to the given shape applying a modification matrix.
Parameters
A map of options to pass to the method.
- toShape - SubtreeShape
- the given shape that gets the assigned values
- modificationMatrix - RotatableNodePlacerMatrix
- the matrix that may add geometrical modifications
Creates a clone of this SubtreeShape instance, modifying it using the provided modification matrix.
Parameters
A map of options to pass to the method.
- matrix - RotatableNodePlacerMatrix
- the matrix that defines the modification for the new instance
Returns
- ↪SubtreeShape
- the clone of this SubtreeShape instance
See Also
Returns the BorderLine instance that describes the SubtreeShape at the given side.
Parameters
A map of options to pass to the method.
- index - number
- one of the predefined borderline directions
Returns
- ↪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.
Remarks
Parameters
A map of options to pass to the method.
- other - SubtreeShape
- the SubtreeShape to be merged with this SubtreeShape
Moves this SubtreeShape instance and its connector by the given offsets.
Remarks
Parameters
A map of options to pass to the method.
- 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.
Returns
- ↪string
- a string representation of the SubtreeShape instance
Adds the line segments of the connector to the bounds of this SubtreeShape instance.