C

CurveRoutingStage

CurveRoutingStage replaces polyline edge paths with curved segments using cubic bezier splines.

Remarks

This layout stage provides a generic way to add curved edge paths for a layout with polyline routes. It first calls the coreLayout and converts the edge routes as a post-processing step. Note that HierarchicalLayout and EdgeRouter offer an integrated curve routing, making the usage of this layout stage unnecessary (see routing styles CURVED and CURVED).

A layout where this stage converted orthogonal edge paths to curved ones (the input is shown below).

The orthogonal input produced by the core layout on which the above curved example is based.

Using the scope, it is possible to select for which edges the path is converted to a curved one. This allows to only change a subset of edges. Furthermore, the CurveRoutingEdgeDescriptor class allows to individually configure settings for edges.

This stage is able to consider node and edge labels, see the respective properties nodeLabelPlacement and edgeLabelPlacement. If edge labels are considered, the EdgeLabelPreferredPlacement is respected too, such that the preferred placement remains correct if it is already correct after the core layout execution.

This stage also supports edge grouping such that edges that are correctly grouped by the core layout algorithm remain grouped in the curved layout result. However, it will not create new groupings. The same applies for other features like, e.g., LayoutPortCandidates. They are only respected if they are already respected by the coreLayout.

Default Values of Properties

NameDefaultDescription
coreLayoutnull
defaultEdgeDescriptorCurveRoutingEdgeDescriptor
edgeLabelPlacementBasicEdgeLabelPlacement.CONSIDER
Edge labels are considered
nodeLabelPlacementBasicNodeLabelPlacement.CONSIDER
Node labels are considered.

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new CurveRoutingStage instance using the given optional coreLayout.

Parameters

coreLayout?: ILayoutAlgorithm
The core layout algorithm

Properties

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 the default CurveRoutingEdgeDescriptor which provides settings that are considered when adding curves to the edge path for edges that have no individual descriptor assigned.
To define individual descriptors per edge, use the layout data property edgeDescriptors.
final

Property Value

Throws

Exception ({ name: 'ArgumentError' })
if the specified CurveRoutingEdgeDescriptor is null

Default Value

The default value is: CurveRoutingEdgeDescriptor

See Also

API
edgeDescriptors
Gets or sets whether or not edge labels are considered when determining curved edge routes.
The edge labels are taken into account when checking for intersections and the routes are prepared to get an associated segment that fits the preferred placement of the label.
In case the labels are not placed yet, there can be unexpected results. Hence, make sure to have the coreLayout place the labels.
conversionfinal

Property Value

CONSIDER if the layout algorithm considers edge labels when moving elements, and IGNORE if the edge labels should be ignored.

Default Value

The default value is: BasicEdgeLabelPlacement.CONSIDER
Edge labels are considered

See Also

API
EdgeLabelPreferredPlacement
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 node labels are considered by the layout stage.
The node labels will be taken into account when checking for intersections and the routes will be prepared to get an associated segment that fits the preferred placement of the label.
conversionfinal

Property Value

CONSIDER if the layout stage considers node labels when moving elements, and IGNORE if the node labels should be ignored.

Default Value

The default value is: BasicNodeLabelPlacement.CONSIDER
Node labels are considered.

Methods

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.
Adds curved segments to the edge routes produced by the coreLayout.
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 CurveRoutingStage.
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 CurveRoutingStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to define the edges affected by the CurveRoutingStage.
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 CurveRoutingStage.

Constants

All constants are filtered. Go to Filters.