This ILayoutGroupBoundsCalculator allows custom insets for group nodes and guarantees that their provided minimum sizes will be maintained.
Remarks
Default Values of Properties
defaultMinimumNodeSize | YDimension(0,0) | A 0 . |
minimumNodeSizeDpKey | MINIMUM_NODE_SIZE_DP_KEY
| |
xAlignment | 0.5 | Nodes grow equally to the left and to the right, while the center remains unchanged. |
yAlignment | 0.5 | Nodes grow equally upwards and downwards, while the center remains unchanged. |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.MinimumSizeGroupBoundsCalculator
See Also
Constructors
Creates a new instance of MinimumSizeGroupBoundsCalculator with default settings.
Creates a new instance of MinimumSizeGroupBoundsCalculator with the given key as minimum node size key.
Parameters
A map of options to pass to the method.
- minSizeDataProviderKey - Object
- the IDataProvider key to use as minimum size key
Properties
Gets or sets whether or not the labels of edges contained in a group are considered while calculating the bounds of the group node.
Default Value
false
.Edge labels are not considered during the group bounds calculation.
Sample Graphs
Defined in
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
Defined in
Gets or sets whether or not the labels of nodes contained in a group are considered while calculating the bounds of the group node.
Default Value
false
.Node labels are not considered during the group bounds calculation.
Sample Graphs
Defined in
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
.
Defined in
Gets or sets the default minimum size (width and height) for group nodes.
Remarks
Default Value
YDimension(0,0)
.A 0
.
Throws
- Exception({ name: 'ArgumentError' })
- if the given
is null
See Also
Sample Graphs
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.Defined in
Gets or sets the key to register a IDataProvider that is used to access the minimum sizes for the group nodes.
Remarks
null
or if the provider yields no value for a group node, then the default minimum size is applied.Default Value
MINIMUM_NODE_SIZE_DP_KEY.See Also
Gets or sets how the nodes are resized horizontally if the calculated width is smaller than the preferred minimum width of a group node.
Remarks
0
and 1
, such that:- A value of
0
means that the nodes grow to the right while the left border remains unchanged. - A value of
1
means that the nodes grow to the left while the right border remains unchanged.
Default Value
0.5
.Nodes grow equally to the left and to the right, while the center remains unchanged.
Throws
- Exception({ name: 'ArgumentError' })
- if the given value does not lie within
[0,1]
Sample Graphs
Gets or sets how the nodes are resized vertically if the calculated height is smaller than the preferred minimum height of a group node.
Remarks
0
and 1
, such that:- A value of
0
means that the nodes grow downwards while the top border remains unchanged. - A value of
1
means that the nodes grow upwards while the bottom border remains unchanged.
Default Value
0.5
.Nodes grow equally upwards and downwards, while the center remains unchanged.
Throws
- Exception({ name: 'ArgumentError' })
- if the given value does not lie within
[0,1]
Sample Graphs
Methods
Calculates the bounds of the given group node, enlarges the bounds by the insets associated with the group node and makes sure that the size of the group node obeys the associated minimum size.
Remarks
The insets associated with the group node will be retrieved from a IDataProvider registered with the graph with the current insets key.
The minimum sizes associated with the group node will be retrieved from a IDataProvider registered with the graph with the current minimum size key.
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
Overrides
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