This ILayoutGroupBoundsCalculator calculates the bounds of group nodes, allows to specify custom padding for each group node, and guarantees that their provided minimum sizes will be maintained.
Remarks
Default Values of Properties
considerEdgeLabels | false | Edge labels are not considered during the group bounds calculation. |
considerNodeLabels | false | Node labels are not considered during the group bounds calculation. |
considerNodeMargins | true | margins are considered during the group bounds calculation. |
defaultMinimumNodeSize | SizeD(0,0) | A 0 . |
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
- algorithms
Constructors
Constructs an instance of GroupBoundsCalculator with default settings.
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.
Property Value
true
if the labels of the edges are considered when calculating the bounds of group nodes, false
otherwiseSample Graphs
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.
Property Value
true
if the labels of the nodes are considered when calculating the bounds of the node's parent group, false
otherwiseSample Graphs
Gets or sets whether the calculation of the bounds of a group node considers the margins associated with the group's child nodes.
Default Value
true
.margins are considered during the group bounds calculation.
Property Value
true
if margins associated with nodes should be considered, false
otherwiseSample Graphs
Gets or sets the default minimum size (width and height) for group nodes.
Remarks
Default Value
SizeD(0,0)
.A 0
.
Property Value
Sample Graphs
Gets or sets the default padding that will be used if the IMapper<K,V> registered with the data key GROUP_NODE_PADDING_DATA_KEY does not contain a mapping for a specific node.
Default Value
Insets(15,15,15,15)
.The padding from the top, left, bottom, and right are set to 15
.
Property Value
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.
Property Value
[0,1]
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.
Property Value
[0,1]
Throws
- Exception({ name: 'ArgumentError' })
- if the given value does not lie within
[0,1]
Sample Graphs
Methods
calculateBounds
(graph: LayoutGraph, groupNode: LayoutNode, children: IListEnumerable<LayoutNode>) : RectCalculates the bounds of the given group node, enlarges the bounds by the padding associated with the group node, and ensures that the size of the group node obeys the associated minimum size.
Remarks
The padding associated with the group node will be retrieved from an IMapper<K,V> registered with the graph with the data key GROUP_NODE_PADDING_DATA_KEY.
The minimum sizes associated with the group node will be retrieved from an IMapper<K,V> registered with the graph with key MINIMUM_GROUP_NODE_SIZE_DATA_KEY or from the property defaultMinimumNodeSize.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- groupNode - LayoutNode
- the group node whose bounds will be calculated
- children - IListEnumerable<LayoutNode>
- an IListEnumerable<Node> containing the nodes that reside inside the group node