FromSketchLayerAssigner assigns nodes to layers by analyzing already existing node coordinates.
Remarks
Nodes whose bounds overlap in the main layout direction are assigned to the same layer. To influence to which amount the boxes need to overlap, the nodes can temporarily be scaled. Alternatively, a minimum and maximum size or margins can be specified for the nodes.
Default Values of Properties
maximumNodeSize | Number.MAX_VALUE
| |
minimumNodeSize | 0.0 | |
nodeMargin | 0.0d | |
nodeScalingFactor | 1.0 |
Type Details
- yFiles module
- algorithms
Constructors
Creates an instance of FromSketchLayerAssigner with default settings.
Parameters
A map of options to pass to the method.
- nodeScalingFactor - number
- The scaling factor used for scaling the size of the nodes. This option sets the nodeScalingFactor property on the created object.
- maximumNodeSize - number
- The maximum size of a node used for calculating layer overlaps. This option sets the maximumNodeSize property on the created object.
- minimumNodeSize - number
- The minimum size of a node used for calculating layer overlaps. This option sets the minimumNodeSize property on the created object.
- nodeMargin - number
- The size of the margins around a node which is used for calculating layer overlaps. This option sets the nodeMargin property on the created object.
Properties
Gets or sets the maximum size of a node used for calculating layer overlaps.
Remarks
This can be used for more fuzzy layering.
The maximum size can take positive values.
Default Value
Number.MAX_VALUE.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified value is less than
0
See Also
Sample Graphs
Gets or sets the minimum size of a node used for calculating layer overlaps.
Remarks
This can be used for more fuzzy layering.
The minimum size can take positive values.
Default Value
0.0
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified value is less than
0
See Also
Sample Graphs
Gets or sets the size of the margins around a node which is used for calculating layer overlaps.
Remarks
If the value of the margin is positive, it specifies a border around a node. In case it is negative, it is considered as an inset that defines a smaller area inside the node.
This can be used for more fuzzy layering.
Default Value
0.0d
.Property Value
See Also
Sample Graphs
Gets or sets the scaling factor used for scaling the size of the nodes.
Remarks
Nodes are being scaled from their center. This can be used for more fuzzy layering.
The scaling factor can take positive values. Factors smaller than 1
only consider large overlaps of the nodes' bounds in the main layout direction. Factors larger than 1
also combine nodes with some distance between them.
Default Value
1.0
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the specified value is less than
0
See Also
Sample Graphs
Methods
Assigns all nodes of the graph to layers by analyzing already existing node coordinates and adds them to the layers instance in the given layoutContext
.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- layoutContext - HierarchicalLayoutContext
- the HierarchicalLayoutContext used for querying information about the nodes and edges
See Also
Implements
Callback used for calculating the lower (max) value of a given node.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph
- node - LayoutNode
- The node
Returns
- ↪number
- The lower (max) value of a given node
Callback used for calculating the upper (min) value of a given node.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph
- node - LayoutNode
- The node
Returns
- ↪number
- The upper (min) value of a given node