BendSubstitutionStage replaces edge bends with proxy nodes for the coreLayout.
Remarks
Concept
Replacing the bends works in three steps:
- Replacing the bends and the edge segments between them with proxy nodes and edges
- Invoking the coreLayout on the altered graph
- Recreating the bends and removing all inserted proxy elements
When the temporary proxy elements have been inserted, edge information about port candidates, edge groups and selection state can be adopted from the original edges. That way, the coreLayout can access the mentioned information.
Default Values of Properties
adoptAffectedEdges | true | The selection state of the original edge is applied to all corresponding proxy edges. |
adoptEdgeGroups | true | Original edge grouping information is applied to the proxy edges. |
adoptPortCandidates | true |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new BendSubstitutionStage instance with the given size as the width and height for the inserted proxy nodes.
Parameters
A map of options to pass to the method.
- size - number
- the size for the proxy nodes
- coreLayout - ILayoutAlgorithm
- the core layout algorithm
- adoptEdgeGroups - boolean
- Whether or not edge grouping information of the original edge should be adopted by its replacement edges. This option sets the adoptEdgeGroups property on the created object.
- adoptPortCandidates - boolean
- Whether or not the associated LayoutPortCandidates of the original edge should be adopted by its replacement edges. This option sets the adoptPortCandidates property on the created object.
- adoptAffectedEdges - boolean
- Whether or not the selection state of the original edge should be adopted by its replacement edges. This option sets the adoptAffectedEdges property on the created object.
- markEdgesForRouting - boolean
- Whether or not the selection state of edges specified with the AFFECTED_EDGES_DATA_KEY should be set as the active routing scope during the execution of the coreLayout. This option sets the markEdgesForRouting property on the created object.
- enabled - boolean
Throws
- Exception({ name: 'ArgumentError' })
- if the given size is negative
Properties
Gets or sets whether or not the selection state of the original edge should be adopted by its replacement edges.
Remarks
Default Value
true
.The selection state of the original edge is applied to all corresponding proxy edges.
Property Value
true
if inserted proxy edges get the selection state of their corresponding original edge, false
otherwiseSee Also
Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges.
Default Value
true
.Original edge grouping information is applied to the proxy edges.
Property Value
true
if inserted proxy edges get the edge grouping information from their corresponding originals, false
otherwiseSee Also
Gets or sets whether or not the associated LayoutPortCandidates of the original edge should be adopted by its replacement edges.
Default Value
true
.Property Value
true
if inserted proxy edges get the LayoutPortCandidates of their corresponding originals, false
otherwiseSee Also
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
Gets or sets whether or not the selection state of edges specified with the AFFECTED_EDGES_DATA_KEY should be set as the active routing scope during the execution of the coreLayout.
Remarks
Default Value
true
.The selection state is propagated as the active routing scope during the execution of the
See Also
Methods
Adds information to newly created proxy nodes.
Remarks
This is a callback method that will be invoked after new elements for the given edge have been added to the given graph by prepare. At this point, the original edge is still in the graph.
The current implementation does nothing.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
- edge - LayoutEdge
- the edge whose bends were replaced by the given proxy nodes
- proxyNodes - YList<LayoutNode>
- the proxy nodes representing the bends of the edge
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
Replaces all bends in the current scope with temporary proxy nodes before invoking the coreLayout.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- The input graph
Implements
createLayoutData
(graph: LayoutGraph) : EdgeScopeData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel,boolean>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to define the edges affected by the BendSubstitutionStage.
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
- ↪EdgeScopeData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel,boolean>
- an instance of layout data that can be used to perform item-specific configurations for the given BendSubstitutionStage.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to define the edges affected by the BendSubstitutionStage.
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
- ↪EdgeScopeData<INode,IEdge,ILabel,ILabel,boolean>
- an instance of layout data that can be used to perform item-specific configurations for the given BendSubstitutionStage.
LayoutExecutor
type is available at runtime.Prepares the graph before calling the coreLayout.
Remarks
The bends of the edges belonging to the current scope are replaced by proxy nodes and the segments between those new nodes are replaced by proxy edges.
Edge-specific information like LayoutPortCandidates, edge groups or selection state can be applied to the proxy edges to keep this information for the coreLayout.
This method is called by applyLayoutImpl before invoking the coreLayout. It may be overridden to extend the edge-specific information that should be adopted by the inserted proxy edges.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Restores the structure of the graph after the coreLayout has finished.
Remarks
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the graph arranged by the coreLayout
See Also
Constants
A data key to register an IMapper<K,V> which identifies edges as selected.