- I
- I
Remarks
Layout Style
Edges are routed organically, i.e. in smooth curves around the nodes observing a minimumDistance to the nodes.
During the routing process, the positions of the nodes are considered to be fixed and the router will not modify their locations or their sizes in any way.
The edge routing algorithm can be applied whenever edge paths should avoid crossing any nodes in organic or cyclic layout styles.
Concept
The edge routing algorithm uses a force-directed approach to calculate the edge paths. Nodes are considered to be repulsive forces while edges will try to become as short as possible.
Each edge is routed separately and is influenced by the nodes in a certain area around it. The algorithm will add bends to the edge path that are placed by balancing the forces.
The quality of the result highly depends on how much space there is between the nodes. More precisely, the distance between each pair of nodes should be at least twice the specified minimumDistance. If it is not necessary that the nodes keep their locations, this can be ensured by enabling allowMovingNodes.
Features
The property minimumDistance will make edges keep a custom distance to the nodes. However, if there is not enough space between the nodes, this distance may be undershot (i.e. edges will be closer to nodes).
OrganicEdgeRouter is able to reuse existing bends. Edges will contain those bends along with other bends added by the layout algorithm. Another feature allows to consider bends such that they influence the route finding, however, their absolute location is not kept (see considerExistingBends).
This layout algorithm handles port placement constraints by applying the portPlacementStage as a postprocessing step.
This edge routing algorithm is realized as a ILayoutStage which can be applied to a graph directly or using a coreLayout.
Default Values of Properties
| Name | Default | Description |
|---|---|---|
| allowEdgeNodeOverlaps | true | Edges are allowed to cross nodes. |
| allowMovingNodes | false | Nodes are not moved. |
| considerExistingBends | false | Bends in the input graph are not considered for edge routing. |
| coreLayout | null | |
| keepExistingBends | false | Bends coordinates in the input graph are not kept fixed. |
| minimumDistance | 10 | |
| routeAllEdges | false | Only edges being too close to nodes are rerouted. |
See Also
Developer's Guide
Members
Constructors
Creates a new OrganicEdgeRouter with the given coreLayout.
Parameters
- coreLayout?: ILayoutAlgorithm
- the core layout algorithm
Properties
Property Value
true if edge-node overlaps are allowed, false otherwiseDefault Value
Sample Graphs
falseSee Also
Developer's Guide
API
- allowMovingNodes, minimumDistance
Property Value
true if nodes are allowed to move a bit to increase the routing quality, false otherwiseDefault Value
See Also
Developer's Guide
API
- allowEdgeNodeOverlaps
Property Value
true if the existing bends are considered, false otherwiseDefault Value
Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets 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.
Defined in
LayoutStageBase.enabledProperty Value
true if the initial bend coordinates are kept, false otherwiseDefault Value
Sample Graphs
See Also
Developer's Guide
The distance also influences how many bends are added to the path (a higher distance leads to fewer bends).
The minimum distance is defined to be a non-negative value.
10.Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the given minimum distance is negative
Default Value
Sample Graphs
10See Also
Developer's Guide
Gets a LayoutStageBase that provides support for EdgePortCandidates, NodePortCandidates or port groups ids.
Since these features are not natively supported by the OrganicEdgeRouter itself, but through additional preprocessing by the portPlacementStage, the quality may vary.
To specify LayoutPortCandidates, NodePortCandidatess, or port group IDs, use the corresponding properties in the OrganicEdgeRouterData<TNode, TEdge, TNodeLabel, TEdgeLabel>.
The stage is enabled by default.
See Also
API
- ports
Property Value
true if all edges are rerouted, false if only a subset is reroutedDefault Value
Sample Graphs
falseMethods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.
Defined in
LayoutStageBase.applyLayoutPerforms the organic routing of the edges of the input graph.
Parameters
- graph: LayoutGraph
- the input graph
Overrides
LayoutStageBase.applyLayoutImplcreateLayoutData
(graph: LayoutGraph): OrganicEdgeRouterData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the OrganicEdgeRouter.
createLayoutData
(graph: LayoutGraph): OrganicEdgeRouterData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>Parameters
- graph: LayoutGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- OrganicEdgeRouterData<LayoutNode, LayoutEdge, LayoutNodeLabel, LayoutEdgeLabel>
- an instance of layout data that can be used to perform item-specific configurations for the given OrganicEdgeRouter.
Returns an instance of LayoutData<TNode, TEdge, TNodeLabel, TEdgeLabel> that can be used to perform item-specific configurations for the OrganicEdgeRouter.
LayoutExecutor type is available at runtime.Parameters
- graph?: IGraph
- the graph that determines the generic type arguments of the created layout data
Return Value
- OrganicEdgeRouterData<INode, IEdge, ILabel, ILabel>
- an instance of layout data that can be used to perform item-specific configurations for the given OrganicEdgeRouter.