documentationfor yFiles for HTML 3.0.0.2

ParallelEdgeRouter

ParallelEdgeRouter is an ILayoutStage that routes multi-edges, which connect the same pair of nodes, in a parallel fashion.

Inheritance Hierarchy
LayoutStageBase
ParallelEdgeRouter
Implemented Interfaces

Remarks

Layout Style

The edge paths of multi-edges consist of parallel segments. At the end points, the edges can either still be parallel or joined in one point.

The leading edge determining the routing is highlighted.

Concept

ParallelEdgeRouter performs four basic steps:

  1. For each set of multi-edges between the same endpoints, the algorithm removes all edges but one from the input graph (the remaining edge is called the leading edge).
  2. Invoke the coreLayout on the graph without multi-edges.
  3. Reinsert all previously removed multi-edges.
  4. Route the multi-edges such that their path is parallel to that of the associated leading edge.

Features

ParallelEdgeRouter can either be used as a ILayoutStage wrapping an ILayoutAlgorithm which cannot handle multi-edges. Then it will hide the multi-edges from this coreLayout and take over the routing of them.

If no coreLayout is specified, ParallelEdgeRouter can work alone. It will route only the multi-edges and keep the remaining graph unchanged. Note that, since the multi-edges' paths are parallel to the path of the associated leading edge, the leading edge should always have a suitable route before calling the ParallelEdgeRouter.

The edges this stage routed can be obtained from routedMultiEdgesResult. Multi-edges that were hidden during the core layout and then routed by this stage are marked. Leading edges are not marked. This may be convenient if multi-edges require further consideration, e.g., to place labels their labels (the core layout could not do that because they were hidden).

Multi-edges can either be all edges between the same two nodes, ignoring the direction, or edges are only considered to be multi-edges if they share the same source node and target node. Hence, they share the same direction.

To make sure that the ports of all multi-edges are on the end nodes, the first and last segments can be joined. However, these segments won't be parallel.

There are two ways to define the distance between two parallel edges. First, an absolute distance can be defined. Parallel segments will keep this distance. Second, the distance can be determined relative to the node bounds. Depending on the size of the nodes and the number of parallel edges between them, the distance between parallel edges is adjusted. This will keep the edges straight in most cases.

It is possible to select custom leading edges. All edges that are multi-edges of the selected edges will be temporarily removed.

Default Values of Properties

adaptiveEdgeDistancestrueThe distances between multi-edges are adjusted to the nodes' bounds.
adjustLeadingEdgetrueThe leading edge is adjusted for more symmetric results.
coreLayoutnull
directedModefalseAll edges that connect the same pair of nodes are considered parallel, ignoring their directions.
edgeDistance10
joinEndsfalseMulti-edges have only parallel segments.

Type Details

yFiles module
algorithms

See Also

In order to obtain suitable routes for the multi-edges, the associated leading edges must have suitable routes, too. This can be achieved by either specifying a suitable coreLayout or by manually removing all bends before applying the ParallelEdgeRouter if the edges should receive straight-line routes. Please also note that routes with very closely placed bends can lead to drawing artifacts.

Constructors

Properties

Methods

Constants

Static Methods