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.
Implements
- I
Remarks
Padding is provided by an IMapper<K, V> that must have been registered with the graph using the data key GROUP_NODE_PADDING_DATA_KEY prior to the invocation of the layout algorithm. Furthermore, it guarantees that a desired minimum size is maintained. The minimum sizes are provided by an IMapper<K, V> registered with the graph using the data key MINIMUM_GROUP_NODE_SIZE_DATA_KEY or by the property defaultMinimumNodeSize.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| 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 Size object with width and height set to 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. |
Members
No filters for this type
Constructors
Constructs an instance of GroupBoundsCalculator with default settings.
Constructs an instance of GroupBoundsCalculator with default settings.
Properties
final
Property Value
true if the labels of the edges are considered when calculating the bounds of group nodes, false otherwiseDefault Value
The default value is: false
Edge labels are not considered during the group bounds calculation.
Sample Graphs
ShownSetting:
falsefinal
Property Value
true if the labels of the nodes are considered when calculating the bounds of the node's parent group, false otherwiseDefault Value
The default value is: false
Node labels are not considered during the group bounds calculation.
Sample Graphs
ShownSetting:
falsefinal
Property Value
true if margins associated with nodes should be considered, false otherwiseDefault Value
The default value is: true
margins are considered during the group bounds calculation.
Sample Graphs
ShownSetting:
falseGets or sets the default minimum size (width and height) for group nodes.
Gets or sets the default minimum size (width and height) for group nodes.
The default minimum size is used if the IMapper<K, V> registered with MINIMUM_GROUP_NODE_SIZE_DATA_KEY does not contain a mapping for a group node.
conversionfinal
Property Value
a Size instance representing the default minimum width and height
Default Value
The default value is: SizeD(0,0)
A Size object with width and height set to
0.Sample Graphs
ShownSetting: Minimum group node size
50 x 50Gets 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.
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.
conversionfinal
Property Value
The default padding used for group nodes without specific padding
Default Value
The default value is: Insets(15,15,15,15)
The padding from the top, left, bottom, and right are set to
15.The alignment is defined to be a value between
0 and 1, such that:- A value of
0means that the nodes grow to the right while the left border remains unchanged. - A value of
1means that the nodes grow to the left while the right border remains unchanged.
final
Property Value
a horizontal alignment value from the interval
[0,1]Throws
- Exception ({ name: 'ArgumentError' })
- if the given value does not lie within
[0,1]
Default Value
The default value is: 0.5
Nodes grow equally to the left and to the right, while the center remains unchanged.
Sample Graphs
ShownSetting: X-alignment
0 when minimum group node size is 200 x 200The alignment is defined to be a value between
0 and 1, such that:- A value of
0means that the nodes grow downwards while the top border remains unchanged. - A value of
1means that the nodes grow upwards while the bottom border remains unchanged.
final
Property Value
a vertical alignment value from the interval
[0,1]Throws
- Exception ({ name: 'ArgumentError' })
- if the given value does not lie within
[0,1]
Default Value
The default value is: 0.5
Nodes grow equally upwards and downwards, while the center remains unchanged.
Sample Graphs
ShownSetting: Y-alignment
0 when minimum group node size is 200 x 200Methods
Calculates 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.
Calculates 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.
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.
For empty group nodes, the calculated bounds will keep the current center of the group node.
This implementation assumes that the given children are contained in the given graph (which is always true if it is called within the RecursiveGroupLayout).
Parameters
- 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