This class is used by HierarchicalLayout during the various phases to provide the drawing details of the nodes of the graph.
Remarks
A HierarchicalLayoutNodeDescriptor instance can be specified individually for single nodes with nodeDescriptors.
This class is designed as a class to allow future additions of new getter methods.
Default Values of Properties
borderToPortGapRatio | 0.5d | Ports are distributed along the sides of the node. |
gridReference | ORIGIN
| The reference point is |
layerAlignment | 0.5d | Nodes are center-aligned within their corresponding layers. |
minimumDistance | 5.0d | |
minimumLayerHeight | 0.0d | |
portAssignment | DEFAULT
| Ports are distributed evenly along the border of the node. |
tabularGroupChildDistance | 0 |
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new instance of a HierarchicalLayoutNodeDescriptor with the default values.
Parameters
A map of options to pass to the method.
- borderToPortGapRatio - number
- The ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent ports) on all sides of the node. This option sets the borderToPortGapRatio property on the created object.
- minimumPortDistance - number
- The minimum distance between ports on all sides of the node. This option sets the minimumPortDistance property on the created object.
- layerAlignment - number
- The alignment of the LayoutNode of this HierarchicalLayoutNodeDescriptor instance within its layer. This option sets the layerAlignment property on the created object.
- minimumLayerHeight - number
- The minimum height of the layer to which this node is assigned. This option sets the minimumLayerHeight property on the created object.
- minimumDistance - number
- The preferred minimum distance to obstacles. This option sets the minimumDistance property on the created object.
- tabularGroupChildDistance - number
- The distance between this node and the other child nodes if they are part of a tabular group structure (tabularGroups). This option sets the tabularGroupChildDistance property on the created object.
- gridReference - Point
- The node's reference point that will be placed on a grid coordinate. This option sets the gridReference property on the created object.
- portAssignment - HierarchicalLayoutPortAssignmentMode
- The assignment strategy which distributes the ports along the node borders. This option sets the portAssignment property on the created object.
Properties
Sets the ratio of the border gap (distance between the outer ports to the node border) to the port gap (distance between adjacent ports) on all sides of the node.
Remarks
This ratio determines the gap between a corner of the node and the first assigned port.
The ratio should be greater than 0
.
A value of 0.0d
results in ports being placed directly on the corner of the node (if there is more than one port).
A value of 0.5d
results in ports being distributed along the side of the node so that the distance between the corner of the node and the first port is half as wide as the distance between two adjacent ports.
A value of Double.POSITIVE_INFINITY
results in all ports being centered at the side in one point.
Default Value
0.5d
.Ports are distributed along the sides of the node.
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given ratio is negative
Sample Graphs
Gets or sets the node's reference point that will be placed on a grid coordinate.
Remarks
Default Value
ORIGIN.The reference point is
Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given grid reference is null
Gets or sets the alignment of the LayoutNode of this HierarchicalLayoutNodeDescriptor instance within its layer.
Remarks
- A value of
0.0d
corresponds to top-alignment. - A value of
0.5d
corresponds to center-alignment. - A value of
1.0d
corresponds to bottom-alignment.
[0,1]
interval.Default Value
0.5d
.Nodes are center-aligned within their corresponding layers.
Property Value
[0,1]
intervalThrows
- Exception({ name: 'ArgumentError' })
- if the alignment is not within the interval
[0,1]
Sample Graphs
Gets or sets the preferred minimum distance to obstacles.
Remarks
Currently, this distance only affects the following scenarios:
- Distance between group nodes and other elements (horizontally and vertically).
- The distance of normal nodes and group node to borders of a layout grid cell or swimlane.
- The segment length of self-loops associated with this node.
The minimum distance should be greater than 0
.
Default Value
5.0d
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the minimum length is negative
Sample Graphs
Gets or sets the minimum height of the layer to which this node is assigned.
Remarks
0
.Default Value
0.0d
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the minimum height is negative
Sample Graphs
Sets the minimum distance between ports on all sides of the node.
Remarks
The node may be enlarged to ensure that the distances between the ports can be at least the given minimum distance. If the original size is already sufficient, it is not changed.
Negative values result in not changing the node size.
A value of 0.0d
results in enlarging the node such that the edges (with given thicknesses) can be packed tightly.
A value larger than 0.0d
results in enlarging the node such that the gaps between edges (with given thicknesses) have at least the required minimum size.
Default Value
-1
.The node size is not changed.
Gets or sets the assignment strategy which distributes the ports along the node borders.
Default Value
Property Value
Gets or sets the distance between this node and the other child nodes if they are part of a tabular group structure (tabularGroups).
Remarks
This setting defines the spacing of child nodes in a tabular group node for which the global nodeDistance is ignored.
By default, this distance is set to zero
to obtain maximally compact tabular group nodes without any spacing between the children.
Default Value
0
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the given distance is negative