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
maximumNonOrthogonalSegmentRatio | 0.5 | |
minimumNodeToEdgeDistance | 10 | |
preferredOctilinearSegmentLength | 50 |
Type Details
- yFiles module
- algorithms
Constructors
Creates a new instance of OctilinearRoutingStage using the given coreLayout.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- the core layout routine
- minimumNodeToEdgeDistance - number
- The minimum distance between edges and node bounds. This option sets the minimumNodeToEdgeDistance property on the created object.
- maximumNonOrthogonalSegmentRatio - number
- The maximum segment length ratio at each end of an orthogonal segment that may get converted into a (non-orthogonal) octilinear segment. This option sets the maximumNonOrthogonalSegmentRatio property on the created object.
- preferredOctilinearSegmentLength - number
- The preferred segment length for (non-orthogonal) octilinear segments. This option sets the preferredOctilinearSegmentLength property on the created object.
- 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
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.
Remarks
0
and 0.5
.Default Value
0.5
.Property Value
[0,0.5]
Throws
- Exception({ name: 'ArgumentError' })
- if the ratio does not lie within
[0,0.5]
interval
Gets or sets the minimum distance between edges and node bounds.
Remarks
0
.Default Value
10
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the distance is negative
Gets or sets the preferred segment length for (non-orthogonal) octilinear segments.
Remarks
0
.Default Value
50
.Property Value
Throws
- Exception({ name: 'ArgumentError' })
- if the length is negative
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
Adds octilinear segments to the edge routes produced by the coreLayout.
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 OctilinearRoutingStage.
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 OctilinearRoutingStage.
Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to define the edges affected by the OctilinearRoutingStage.
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 OctilinearRoutingStage.
LayoutExecutor
type is available at runtime.