FixNodeLayoutStage fixes the initial position of either a single node or the alignment of the bounding box of several nodes (but not the positions of the individual nodes).
Remarks
Default Values of Properties
fixPointPolicy | CENTER
| |
includingEdges | false | Subgraph edges are not taken into account. |
includingLabels | false | Label geometries are not taken into account. |
Type Details
- yfiles module
- layout-core
- yfiles-umd modules
- All layout modules, view-layout-bridge
- Legacy UMD name
- yfiles.layout.FixNodeLayoutStage
Sample Graphs
Constructors
Creates a new FixNodeLayoutStage instance with an optional core layout algorithm.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm.
- fixPointPolicy - FixPointPolicy
The fix point calculation policy used in calculateFixPoint to determine which point in the corresponding rectangle should be considered fixed. This option sets the fixPointPolicy property on the created object.
- includingEdges - boolean
Whether or not subgraph edges are taken into account when calculating the bounding box of the fixed nodes. This option sets the includingEdges property on the created object.
- includingLabels - boolean
Whether or not label geometries are taken into account when calculating the bounding box of the fixed nodes. This option sets the includingLabels property on the created object.
Properties
Gets or sets the core layout algorithm that is wrapped by this stage.
Gets or sets the fix point calculation policy used in calculateFixPoint to determine which point in the corresponding rectangle should be considered fixed.
Gets or sets whether or not subgraph edges are taken into account when calculating the bounding box of the fixed nodes.
Default Value
false
.Subgraph edges are not taken into account.
See Also
Gets or sets whether or not label geometries are taken into account when calculating the bounding box of the fixed nodes.
Default Value
false
.Label geometries are not taken into account.
See Also
Methods
Delegates to the core layout algorithm and moves the fixed point back to its initial location.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Invokes the layout process of the core layout algorithm.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Defined in
Calculates the bounding box of the specified nodes.
Remarks
The calculated bounds may contain edges and/or labels.
This method is called by calculateFixPoint and may be overridden to customize the size of the bounds.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph associated with the specified nodes
- fixedNodes - YNodeList
- the list of nodes for which to determine the bounding box
Returns
- ↪Rectangle2D
- the bounding box of the specified nodes
See Also
Calculates the fix point for the specified nodes in the specified graph.
Remarks
The default implementation calls calculateBounds and calculateFixPoint.
This method is called by applyLayout to determine the point that will have the same coordinates before and after invoking the core layout algorithm. It may be overridden to introduce a custom policy for retrieving the fix point.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph associated with the specified nodes
- fixedNodes - YNodeList
- the list of nodes for which a fix point has to be determined
Returns
- ↪YPoint
- the fix point for the specified nodes in the specified graph
See Also
Calculates the fix point of the specified rectangle according to the policy returned by fixPointPolicy.
Remarks
If the specified rectangle is null
or the rectangle has negative width
or negative height
then null
will be returned.
This method is called by calculateFixPoint. It may be overridden to introduce a custom policy for retrieving the fix point.
Parameters
A map of options to pass to the method.
- bounds - Rectangle2D
- the rectangle for which to determine the fix point
Returns
- ↪YPoint
- the fix point of the specified rectangle or
null
if nothing should be fixed
Throws
- Exception({ name: 'ArgumentError' })
- if the current fix point policy is invalid
See Also
Constants
A data provider key for determining the nodes that should be considered fixed.
Domain | YNode | |
Values | boolean | true if the node is fixed, false otherwise |