documentationfor yFiles for HTML 2.6

BusRouter

An edge routing algorithm which routes edges of a graph in an orthogonal bus-style.

Inheritance Hierarchy
Implemented Interfaces

Remarks

Carefully observe that the resulting bus representation, with many edge segments drawn on top of each other, leaves little room for a sensible interpretation of edge direction.

Note that class EdgeRouter offers a newer, improved bus-style support (also see EdgeRouterBusDescriptor) and it is recommended to use this instead.

Layout Style

Edge segments are bundled to buses. A bus is a segment shared by multiple edges to which shorter segments that connect to actual nodes are attached. Buses and all other segments are routed orthogonally.

A bus can, for example, be created in parts of a diagram where each node is connected to each other node. There are no cycles induced by any two edge paths of the same bus, that is, the combination of all edge routes looks like an orthogonal tree.

The algorithm tries to produce routes where the edges share as much of their paths as possible. It yields long line segments (so-called backbone segments) where ideally all but the first and last segments of all edge paths are drawn on top of each other (forming a bus), with short connections branching off to the nodes (bus connections). These short connections bundle the respective first or last segments of a node's incident edges.

This algorithm will not modify positions or sizes of nodes in any way, but will route the edges of the graph.

Bus-style edge routing with default settings

Edge routing sample including four different buses

Concept

The algorithm uses a two-phase process:

  1. Backbone Selection: a set of suitable initial backbone segments is determined.
  2. Routing and Recombination: each initial backbone segment is connected to all other backbone segments and to each node by using orthogonal edge paths. Then, the resulting structure is reduced to the most optimal structure where backbone segments are long and connections to the nodes are short.

Features

To determine which edges belong to a common bus, a mapping that assigns a bus ID to each edge must be specified using BusRouterBusDescriptors. A IDataProvider holding BusRouterBusDescriptor instances is expected to be registered with the graph using the descriptor key. In the absence of an individual bus ID for an edge, a bus consisting only of the single edge is created.

This algorithm supports PortConstraints as well as PortCandidates to control where edges should connect to nodes.

Note that if edges of the same bus connect to a common node but have inconsistent or contradicting port constraints/candidates, then any of these constraints/candidates can determine the actual location of the common port. The same applies for edges that, in addition, belong to the same edge group.

Also, the cardinality defined with a PortCandidateSet object is interpreted in terms of different bus IDs (group IDs) instead of number of edges.

This algorithm supports incremental edge routing, that is, extending or updating an already existing bus-style representation. This is useful to rearrange existing edges or to include additional edges in an existing bus.

Incremental routing is supported by denoting so-called fixed edges using the corresponding BusDescriptor property. The paths of edges which are not marked as fixed are calculated by the algorithm. The structure induced by the fixed edges must be orthogonal and cycle-free.

Default Values of Properties

crossingCost1.0One direction change is preferred over the crossing of an edge.
gridRoutingfalseEdges are freely routed.
gridSpacing10
minimumBusConnectionsCount3
minimumDistanceToEdge5
minimumDistanceToNode10
preferredBackboneSegmentCount2
scopeROUTE_ALL_EDGES

Type Details

yfiles module
router-bus
yfiles-umd modules
router-bus, layout
Legacy UMD name
yfiles.router.BusRouter

See Also

Constructors

Properties

Methods

Constants