C

BundledEdgeRouter

An ILayoutStage that bundles the edges of general undirected graphs to reduce visual clutter.

Remarks

Edge bundling merges the common parts of multiple edges to increase the readability of dense graph drawings. This technique prevents the chaotic "hairball" effect and helps reveal structural patterns in the connectivity that would otherwise be obscured by overlapping straight lines.

This stage generates bundled edge paths for any given layout, i.e., the layout generated by a specified LayoutStageBase.coreLayout. It ignores the current bends of the edges. Furthermore, it doesn't prevent node-edge intersections, although using strategy BundledEdgeRouterStrategy.VORONOI reduces such intersections.

A result of this stage with default settings

Concept

The algorithm provides various strategies that implement distinct approaches to determine how edges are bundled and routed. By default, the BundledEdgeRouterStrategy.SPANNER strategy is applied.

Features

Global bundling settings can be configured using an edgeBundling instance:

  • EdgeBundling.bundlingStrength controls how many edges are bundled together. The default value for this algorithm is 0.75.
  • EdgeBundling.bundlingQuality influences the quality of the bundling. Larger values typically increase quality but require longer calculation time. The default is 1.0.

The individual style of each edge can be configured with BundledEdgeRouterData<TNode, TEdge, TNodeLabel, TEdgeLabel>.edgeBundleDescriptors. This allows, for example, defining which edges should actually be bundled.

For the best visual results, render edges with an opacity/transparency factor. This emphasizes strongly bundled edges while de-emphasizing unbundled ones.

Default Values of Properties

NameDefaultDescription
coreLayoutnull
stopDurationTimeSpan.MAX_VALUE
The bundling algorithm runs unrestricted.
strategyBundledEdgeRouterStrategy.SPANNER

See Also

Developer's Guide

Members

Show:

Constructors

Creates a new BundledEdgeRouter instance with the given optional core layout algorithm and default settings.

Parameters

coreLayout?: ILayoutAlgorithm
The core layout algorithm

Properties

Gets or sets the core ILayoutAlgorithm that is wrapped by this stage.
final

Property Value

the core layout routine

Default Value

The default value is: null
Gets the EdgeBundling instance that defines the settings of the edge bundling feature.

The specified EdgeBundling defines global bundling properties. Settings for individual edges can be defined by assigning an EdgeBundleDescriptor to an edge with BundledEdgeRouterData<TNode, TEdge, TNodeLabel, TEdgeLabel>.edgeBundleDescriptors.

By default, all edges are bundled (property EdgeBundleDescriptor.bundled of the default bundle descriptor is enabled). The default for EdgeBundling.bundlingStrength is 0.75 and the default for property EdgeBundling.bundlingQuality is 1.0.

readonlyfinal

Property Value

the EdgeBundling instance defining the edge bundling setup
Gets 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.

final
Gets or sets the stop duration that this bundling algorithm is allowed to run.
The duration needs to be non-negative.
Restricting the stop duration may result in a lower bundling quality. Furthermore, the real runtime may exceed the stop duration since the algorithm still has to find a valid solution.
conversionfinal

Property Value

the non-negative duration

Throws

Exception ({ name: 'ArgumentError' })
if the specified duration has a negative value

Default Value

The default value is: TimeSpan.MAX_VALUE
The bundling algorithm runs unrestricted.
Gets or sets the strategy for bundling the edges.
conversionfinal

Property Value

the specified strategy for bundling the edges

Default Value

The default value is: BundledEdgeRouterStrategy.SPANNER

Methods

Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
This implementation checks the enabled state and when it's not enabled, will delegate to the coreLayout, directly. When the stage is enabled, all the work will be delegated to applyLayoutImpl, instead.
final

Parameters

graph: LayoutGraph
The graph to apply the layout to.
Applies the edge bundling algorithm after invoking the LayoutStageBase.coreLayout.
protected

Parameters

graph: LayoutGraph
the input graph