C

OctilinearRoutingStage

OctilinearRoutingStage creates octilinear edge routes by extending given orthogonal edge paths with polyline segments.

Remarks

Important: The current implementation only adds octilinear segments to all given orthogonal edges. Non-orthogonal edges are completely ignored. To create new routes in any case, apply EdgeRouter with routing style OCTILINEAR.

An octilinear segment is added between two consecutive vertical and horizontal segments. The length of an octilinear segment can be influenced by the maximumNonOrthogonalSegmentRatio and the preferredOctilinearSegmentLength. The inserted segments maintain a customizable minimum distance between the edges and all nodes in the graph if possible.

Default Values of Properties

NameDefault
coreLayoutnull
maximumNonOrthogonalSegmentRatio0.5
minimumNodeToEdgeDistance10
preferredOctilinearSegmentLength50

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new instance of OctilinearRoutingStage using the given coreLayout.

Parameters

coreLayout?: ILayoutAlgorithm
the core layout routine

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 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 the maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) octilinear segment.
The ratio must be between 0 and 0.5.
final

Property Value

a value from the interval [0,0.5]

Throws

Exception ({ name: 'ArgumentError' })
if the ratio does not lie within [0,0.5] interval

Default Value

The default value is: 0.5
Gets or sets the minimum distance between edges and node bounds.
Values should be greater than or equal to 0.
final

Property Value

the minimum distance between edges and node bounds

Throws

Exception ({ name: 'ArgumentError' })
if the distance is negative

Default Value

The default value is: 10
Gets or sets the preferred segment length for (non-orthogonal) octilinear segments.
Values should be greater than or equal to 0.
final

Property Value

the preferred segment length for (non-orthogonal) octilinear segments

Throws

Exception ({ name: 'ArgumentError' })
if the length is negative

Default Value

The default value is: 50

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 octilinear 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 OctilinearRoutingStage.
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 OctilinearRoutingStage.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to define the edges affected by the OctilinearRoutingStage.
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 OctilinearRoutingStage.