This edge routing algorithm applies organic routes to the edges of the graph.
Remarks
Layout Style
Edges are routed organically, i.e. in smooth curves around the nodes observing a minimum distance 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 minimum distance. If it is not necessary that the nodes keep their locations, this can be ensured using a combination of RemoveOverlapsStage and node enlargement stage.
Features
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 edge routing algorithm is realized as a ILayoutStage which can be applied to a graph directly or using a core layout algorithm.
Default Values of Properties
considerExistingBends | false | Bends in the input graph are not considered for edge routing. |
edgeNodeOverlapAllowed | true | Edges are allowed to cross nodes. |
keepExistingBends | false | Bends coordinates in the input graph are not kept fix. |
minimumDistance | 10 | |
routeAllEdges | false | Only edges being too close to nodes are rerouted. |
Type Details
- yfiles module
- router-other
- yfiles-umd modules
- layout-familytree, layout-multipage, layout-orthogonal-compact, layout, router-bus, router-other
- Legacy UMD name
- yfiles.router.OrganicEdgeRouter
See Also
Constructors
Creates a new OrganicEdgeRouter with the given core layout algorithm.
Parameters
A map of options to pass to the method.
- coreLayout - ILayoutAlgorithm
- the core layout algorithm
- edgeNodeOverlapAllowed - boolean
Whether or not edges are allowed to cross nodes. This option sets the edgeNodeOverlapAllowed property on the created object.
- minimumDistance - number
The minimum distance the algorithm should guarantee between nodes and non-incident edges. This option sets the minimumDistance property on the created object.
- keepExistingBends - boolean
Whether or not the initial bend coordinates are kept when determining the edge path. This option sets the keepExistingBends property on the created object.
- considerExistingBends - boolean
Whether or not the initial bend coordinates influence the path routing such that the calculated routes tend to have a similar overall shape. This option sets the considerExistingBends property on the created object.
- routeAllEdges - boolean
Whether a rerouting step is performed on all edges or just on a subset where distances are violated. This option sets the routeAllEdges property on the created object.
Properties
Gets or sets whether or not the initial bend coordinates influence the path routing such that the calculated routes tend to have a similar overall shape.
Remarks
Default Value
false
.Bends in the input graph are not considered for edge routing.
Gets or sets the core layout algorithm which arranges the graph before edge routing.
Gets or sets whether or not edges are allowed to cross nodes.
Remarks
Default Value
true
.Edges are allowed to cross nodes.
See Also
Sample Graphs
Gets or sets whether or not the initial bend coordinates are kept when determining the edge path.
Remarks
Default Value
false
.Bends coordinates in the input graph are not kept fix.
See Also
Sample Graphs
Gets or sets the minimum distance the algorithm should guarantee between nodes and non-incident edges.
Remarks
The distance also influences how many bends are added to the path (a higher distance leads to less bends).
The minimum distance is defined to be a non-negative value.
Default Value
10
.Throws
- Exception({ name: 'ArgumentError' })
- if the given minimum distance is negative
See Also
Sample Graphs
10
.Gets or sets whether a rerouting step is performed on all edges or just on a subset where distances are violated.
Remarks
Default Value
false
.Only edges being too close to nodes are rerouted.
See Also
Sample Graphs
Methods
Performs the organic routing of the edges of the input graph.
Parameters
A map of options to pass to the method.
- graph - LayoutGraph
- the input graph
See Also
Implements
Returns a ILayoutStage which temporarily increases the sizes of the nodes to avoid overlaps.
Remarks
Returns
- ↪ILayoutStage
- the ILayoutStage that resizes the nodes
See Also
Constants
A data provider key for selecting edges that should be routed.