C

StraightLineEdgeRouter

This edge routing algorithm routes edges as straight lines considering the specified LayoutPortCandidates.

Remarks

Layout Style

The edges connect to their ports with straight lines. This may lead to edges crossing nodes.

Concept

StraightLineEdgeRouter will first invoke the coreLayout if one exists. Then, it will remove all bends from the edges and will place the ports either in the center of the nodes or at a location specified by EdgePortCandidates and NodePortCandidates. Port groups are handled as a postprocessing step by the portPlacementStage.

Default Values of Properties

NameDefault
coreLayoutnull

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new instance of StraightLineEdgeRouter with an 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 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 a LayoutStageBase that provides support for EdgePortCandidates, NodePortCandidates or port groups.

To specify EdgePortCandidates, NodePortCandidates, or port group IDs, use the corresponding properties in the BasicPortData<TNode, TEdge, TNodeLabel, TEdgeLabel> accessed via ports.

This LayoutStageBase is enabled by default, and its routeCorrectionPolicy is set to MOVE_PORTS.

readonlyfinal

See Also

API
ports

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.
Routes the edges as straight lines from their source to their target after invoking the coreLayout.
protected

Parameters

graph: LayoutGraph
the input graph
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the StraightLineEdgeRouter.
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

StraightLineEdgeRouterData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
an instance of layout data that can be used to perform item-specific configurations for the given StraightLineEdgeRouter.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the StraightLineEdgeRouter.
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

StraightLineEdgeRouterData<INode, IEdge, ILabel, ILabel>
an instance of layout data that can be used to perform item-specific configurations for the given StraightLineEdgeRouter.