This class is used by HierarchicLayoutCore during the various phases to provide the drawing details of the nodes of the graph.
Remarks
A HierarchicLayoutNodeLayoutDescriptor instance can be specified individually for single nodes using a IDataProvider that returns a HierarchicLayoutNodeLayoutDescriptor instance for each node of the graph, or null
if no HierarchicLayoutNodeLayoutDescriptor is bound to an edge. The IDataProvider is registered with the graph with key NODE_LAYOUT_DESCRIPTOR_DP_KEY.
This class is designed as a class to allow future additions of new getter methods.
Default Values of Properties
gridReference | ORIGIN
| The reference point is |
layerAlignment | 0.5d | Nodes are center-aligned within their corresponding layers. |
minimumDistance | 5.0d | |
minimumLayerHeight | 0.0d | |
nodeLabelMode | CONSIDER_FOR_DRAWING
| Node labels will be considered for node placement and routing, but not for self-loops. |
portAssignment | DEFAULT
| Ports are distributed evenly along the border of the node. |
portBorderGapRatios | 0.5d | Ports are distributed along the sides of the node. |
tabularGroupChildDistance | 0 |
Type Details
- yfiles module
- layout-hierarchic
- yfiles-umd modules
- layout-familytree, layout-hierarchic, layout-radial, layout
- Legacy UMD name
- yfiles.hierarchic.NodeLayoutDescriptor
See Also
Constructors
Creates a new instance of a HierarchicLayoutNodeLayoutDescriptor with the default values.
Parameters
A map of options to pass to the method.
- portBorderGapRatios - number
The port border gap ratio for the port distribution on all sides of the node. This option sets the portBorderGapRatios property on the created object.
- layerAlignment - number
The alignment of the node of this HierarchicLayoutNodeLayoutDescriptor instance within its layer. This option sets the layerAlignment property on the created object.
- nodeLabelMode - NodeLabelMode
The mode that determines how node labels are handled by the algorithm during the layout. This option sets the nodeLabelMode 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 ones if they are part of a tabular group structure (TABULAR_GROUPS_DP_KEY). This option sets the tabularGroupChildDistance property on the created object.
- gridReference - YPoint
The node's reference point that will be placed on a grid coordinate. This option sets the gridReference property on the created object.
- portAssignment - HierarchicLayoutPortAssignmentMode
The assignment strategy which distributes the ports along the node borders. This option sets the portAssignment property on the created object.
Properties
Gets or sets the node's reference point that will be placed on a grid coordinate.
Remarks
Default Value
ORIGIN.The reference point is
Throws
- Exception({ name: 'ArgumentError' })
- if the given grid reference is null
See Also
Gets or sets the alignment of the node of this HierarchicLayoutNodeLayoutDescriptor 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.
Throws
- Exception({ name: 'ArgumentError' })
- if the alignment is not within [0.0d .. 1.0d]
See Also
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 partition 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
.Throws
- Exception({ name: 'ArgumentError' })
- if the minimum length is negative
See Also
Sample Graphs
Gets or sets the minimum height of the layer to which this node is assigned.
Remarks
0
.Default Value
0.0d
.Throws
- Exception({ name: 'ArgumentError' })
- if the minimum height is negative
See Also
Sample Graphs
Gets or sets the mode that determines how node labels are handled by the algorithm during the layout.
Default Value
CONSIDER_FOR_DRAWING.Node labels will be considered for node placement and routing, but not for self-loops.
Throws
- Exception({ name: 'ArgumentError' })
- if the constant is unknown.
See Also
true
. Otherwise, one has to assure that e.g., via an instance of LabelLayoutTranslator, the algorithm receives the appropriate information.Gets or sets the assignment strategy which distributes the ports along the node borders.
Default Value
See Also
Sets the port border gap ratio for the port distribution 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.
Throws
- Exception({ name: 'ArgumentError' })
- if the given ratio is negative
See Also
Sample Graphs
Gets or sets the distance between this node and the other child nodes ones if they are part of a tabular group structure (TABULAR_GROUPS_DP_KEY).
Remarks
This setting defines the spacing of child nodes in a tabular group node for which the global node-to-node distance 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
.Throws
- Exception({ name: 'ArgumentError' })
- if the given distance is negative
See Also
Sample Graphs
Methods
Returns the port border gap ratio for the port distribution at a given side 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.
Parameters
A map of options to pass to the method.
- side - number
- the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0)
Returns
- ↪number
- the border gap ratio of a given side
See Also
Specifies the port border gap ratio for the port distribution at a given side 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.
Parameters
A map of options to pass to the method.
- side - number
- the zero-based clockwise side index for top-to-bottom layouts (i.e., top is 0)
- ratio - number
- the given ratio
Throws
- Exception({ name: 'ArgumentError' })
- if the given ratio is negative