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
coreLayout | null |
Type Details
- yFiles module
- algorithms
See Also
Constructors
Creates a new instance of StraightLineEdgeRouter with an optional coreLayout.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- The core layout algorithm.
- enabled - boolean
Properties
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Default Value
null
.Property Value
See Also
Implements
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.
See Also
Implements
Gets a LayoutStageBase that provides support for EdgePortCandidates, NodePortCandidates or port groups.
Remarks
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.
See Also
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.
See Also
Implements
Routes the edges as straight lines from their source to their target after invoking the coreLayout.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
createLayoutData
(graph: LayoutGraph) : StraightLineEdgeRouterData<LayoutNode,LayoutEdge,LayoutNodeLabel,LayoutEdgeLabel>Returns an instance of LayoutData<TNode,TEdge,TNodeLabel,TEdgeLabel> that can be used to perform item-specific configurations for the StraightLineEdgeRouter.
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
- ↪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.
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
- ↪StraightLineEdgeRouterData<INode,IEdge,ILabel,ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given StraightLineEdgeRouter.
LayoutExecutor
type is available at runtime.