This ILayoutGroupBoundsCalculator calculates the bounds of group nodes and allows to specify custom insets for each group node.
Remarks
Default Values of Properties
considerEdgeLabels | false | Edge labels are not considered during the group bounds calculation. |
considerNodeHalos | true | |
considerNodeLabels | false | Node labels are not considered during the group bounds calculation. |
groupNodeInsetsDpKey | GROUP_NODE_INSETS_DP_KEY
|
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.InsetsGroupBoundsCalculator
Constructors
Constructs an instance of InsetsGroupBoundsCalculator using the given IDataProvider key as group node insets key and the given insets as default insets.
Parameters
A map of options to pass to the method.
- groupNodeInsetsDPKey - Object
- the IDataProvider key to use as insets key
- defaultInsets - YInsets
- the insets to use as default insets
Properties
Gets or sets whether or not the calculation of the bounds of a group node considers the NodeHalos associated with the group's child nodes.
Default Value
true
.Sample Graphs
Gets or sets the default insets that will be used if the IDataProvider registered with the insets key does not contain a mapping for a specific node.
Default Value
Insets(15,15,15,15)
.The insets from the top, left, bottom and right are set to 15
.
Gets or sets the key to register a IDataProvider that is used to access the insets for the group nodes.
Remarks
Default Value
GROUP_NODE_INSETS_DP_KEY.Methods
Calculates the bounds of the given group node and enlarges the bounds by the insets associated with the group node.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- groupNode - YNode
- the group node whose bounds will be calculated
- children - YNodeList
- a YNodeList containing the nodes that reside inside the group node
Returns
- ↪Rectangle2D
- a Rectangle2D instance that describes the bounds of the group node
Implements
createEnlargedBounds
(graph: LayoutGraph, groupNode: YNode, children: YNodeList, bounds: Rectangle2D) : Rectangle2DEnlarges the given graph bounds by the insets associated with the given group node.
Remarks
The insets associated with the group node will be retrieved from a IDataProvider registered with the graph with the current insets key.
This method is called while calculating the group bounds to realize the support for custom insets. It may be overridden to change the way specific insets influence the group node bounds.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- groupNode - YNode
- the group node whose bounds should be enlarged
- children - YNodeList
- the list of nodes that the given group node contains
- bounds - Rectangle2D
- a Rectangle2D instance representing the bounds of the given group node
Returns
- ↪Rectangle2D
- a Rectangle2D instance representing the enlarged bounds of the given group node