C

BendSubstitutionStage

BendSubstitutionStage replaces edge bends with proxy nodes for the coreLayout.

Remarks

Concept

Replacing the bends works in three steps:

  1. Replacing the bends and the edge segments between them with proxy nodes and edges
  2. Invoking the coreLayout on the altered graph
  3. 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

NameDefaultDescription
adoptAffectedEdgestrue
The selection state of the original edge is applied to all corresponding proxy edges.
adoptEdgeGroupstrue
Original edge grouping information is applied to the proxy edges.
adoptPortCandidatestrue
LayoutPortCandidates of the original edges are applied to the proxy edges.
coreLayoutnull

Members

Show:

Constructors

Creates a new BendSubstitutionStage instance with the given size as the width and height for the inserted proxy nodes.

Parameters

size?: number
the size for the proxy nodes
coreLayout?: ILayoutAlgorithm
the core layout algorithm

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.
The selection state is looked up in an IMapper<K, V> registered with the key returned by AFFECTED_EDGES_DATA_KEY.
final

Property Value

true if inserted proxy edges get the selection state of their corresponding original edge, false otherwise

Default Value

The default value is: true
The selection state of the original edge is applied to all corresponding proxy edges.

See Also

API
AFFECTED_EDGES_DATA_KEY
Gets or sets whether or not edge grouping information of the original edge should be adopted by its replacement edges.
final

Property Value

true if inserted proxy edges get the edge grouping information from their corresponding originals, false otherwise

Default Value

The default value is: true
Original edge grouping information is applied to the proxy edges.

See Also

API
SOURCE_EDGE_GROUP_ID_DATA_KEY, TARGET_EDGE_GROUP_ID_DATA_KEY
Gets or sets whether or not the associated LayoutPortCandidates of the original edge should be adopted by its replacement edges.
final

Property Value

true if inserted proxy edges get the LayoutPortCandidates of their corresponding originals, false otherwise

Default Value

The default value is: true
LayoutPortCandidates of the original edges are applied to the proxy edges.

See Also

API
SOURCE_PORT_CANDIDATES_DATA_KEY, TARGET_PORT_CANDIDATES_DATA_KEY
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets or sets a value that determines whether this stage should do anything but execute the coreLayout.

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.

final
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.
If this property is set, the IMapper<K, V> specifying the affected edges temporarily replaces any IMapper<K, V> associated with the ROUTE_EDGES_DATA_KEY in the LayoutGraphContext until the coreLayout returns. Any edge routing algorithm whose scope can be defined using this key will be applied only to the edges affected by the BendSubstitutionStage and any edges inserted by this stage, provided the selection state is adopted.
final

Default Value

The default value is: true
The selection state is propagated as the active routing scope during the execution of the coreLayout.

See Also

API
AFFECTED_EDGES_DATA_KEY, adoptAffectedEdges

Methods

Adds information to newly created proxy nodes.

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.

protected

Parameters

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.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
Replaces all bends in the current scope with temporary proxy nodes before invoking the coreLayout.
After the coreLayout has finished, the edges between the temporary proxy nodes are reconnected and the proxy nodes are replaced by bends again.
protected

Parameters

graph: LayoutGraph
The input graph
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to define the edges affected by the BendSubstitutionStage.
The generic type arguments of the created layout data are compatible with instances of LayoutGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.

Parameters

graph: LayoutGraph
the graph that determines the generic type arguments of the created layout data

Return Value

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.
The generic type arguments of the created layout data are compatible with instances of IGraph, but the layout data is not bound to a specific graph instance. Therefore, the created layout data still has to be passed as an argument of applyLayout in order to be applied.
This method is not available unless the module view-layout-bridge is loaded. Either load the module 'view-layout-bridge' explicitly or ensure that the LayoutExecutor type is available at runtime.

Parameters

graph: IGraph
the graph that determines the generic type arguments of the created layout data

Return Value

EdgeScopeData<INode, IEdge, ILabel, ILabel, boolean>
an instance of layout data that can be used to perform item-specific configurations for the given BendSubstitutionStage.
Prepares the graph before calling the coreLayout.

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.

All changes to the graph should be reverted in restore.
protected

Parameters

graph: LayoutGraph
the input graph

See Also

API
restore, adoptAffectedEdges, adoptPortCandidates, adoptEdgeGroups
Restores the structure of the graph after the coreLayout has finished.
This method is called by applyLayoutImpl after invoking the coreLayout. It may be overridden to clean up all additional information added in prepare.
All changes to the graph made in prepare should be reverted by this method.
protected

Parameters

graph: LayoutGraph
the graph arranged by the coreLayout

See Also

API
prepare, adoptAffectedEdges, adoptPortCandidates, adoptEdgeGroups

Constants

A data key to register an IMapper<K, V> which identifies edges as selected.
If the selection is conserved, the selection state described by the IMapper<K, V> registered with this key is applied to the according proxy edges.
static

See Also

API
adoptAffectedEdges