LayoutAnchoringStage anchors the graph on an initial position based on either a single graph item or the alignment of the bounds of several items (but not the positions of the individual items).
Remarks
Type Details
- yFiles module
- algorithms
Sample Graphs
Constructors
Creates a new LayoutAnchoringStage instance with an optional core layout algorithm.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm.
- enabled - boolean
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.
Remarks
By default, when constructed, stages should be enabled. Users may disable a stage's functionality by setting this property to false
.
Stages that can guarantee that the graph will not change can choose to not even execute the coreLayout when disabled.
Implements
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The graph to apply the layout to.
Implements
Delegates to the core layout algorithm and moves the graph to where the anchor point coincides with its initial location.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
Implements
Calculates the anchor point based on the references provided.
Remarks
The default implementation calculates the union of the provided references and returns its center.
This method is called by applyLayoutImpl to determine the point that will have the same coordinates before and after invoking the coreLayout. It may be overridden to introduce a custom policy for retrieving the anchor point.
Parameters
A map of options to pass to the method.
- references - IEnumerable<Rect>
- The references for which to calculate the anchor point.
Returns
- ↪Point?
- The calculated anchor point based on the references provided.
createLayoutData
(graph: LayoutGraph) : LayoutAnchoringStageData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the LayoutAnchoringStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪LayoutAnchoringStageData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given LayoutAnchoringStage.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the LayoutAnchoringStage.
Remarks
Parameters
A map of options to pass to the method.
- graph - IGraph
- the graph that determines the generic type arguments of the created layout data
Returns
- ↪LayoutAnchoringStageData<INode,IEdge,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given LayoutAnchoringStage.
LayoutExecutor
type is available at runtime.Gets the reference bounds for a node based on the specified LayoutAnchoringPolicy.
Parameters
A map of options to pass to the method.
- node - LayoutNode
- The node for which to retrieve the reference bounds.
- policy - LayoutAnchoringPolicy
- The LayoutAnchoringPolicy for the node.
Returns
- ↪Rect
- The reference bounds for the node.
Gets the reference bounds for an edge based on the specified LayoutAnchoringPolicy.
Parameters
A map of options to pass to the method.
- edge - LayoutEdge
- The edge for which to retrieve the reference bounds.
- policy - LayoutAnchoringPolicy
- The LayoutAnchoringPolicy for the edge.
Returns
- ↪Rect
- The reference bounds for the edge.
Gets the reference bounds for a node label based on the specified LayoutAnchoringPolicy.
Parameters
A map of options to pass to the method.
- label - LayoutNodeLabel
- The node label for which to retrieve the reference bounds.
- policy - LayoutAnchoringPolicy
- The LayoutAnchoringPolicy for the node label.
Returns
- ↪Rect
- The reference bounds for the node label.
Gets the reference bounds for an edge label based on the specified LayoutAnchoringPolicy.
Parameters
A map of options to pass to the method.
- label - LayoutEdgeLabel
- The edge label for which to retrieve the reference bounds.
- policy - LayoutAnchoringPolicy
- The LayoutAnchoringPolicy for the edge label.
Returns
- ↪Rect
- The reference bounds for the edge label.
Constants
A data key used to specify the edges that should be used to calculate the anchor point.
Remarks
See Also
A data key used to specify the edge labels that should be used to calculate the anchor point.
Remarks
See Also
A data key used to specify the nodes that should be used to calculate the anchor point.
Remarks
See Also
A data key used to specify the node labels that should be used to calculate the anchor point.