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.
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
| Name | Default | Description |
|---|---|---|
| coreLayout | null | |
| stopDuration | TimeSpan.MAX_VALUE | The bundling algorithm runs unrestricted. |
| strategy | BundledEdgeRouterStrategy.SPANNER |
See Also
Developer's Guide
Members
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.
Property Value
Default Value
Defined in
LayoutStageBase.coreLayoutGets 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.
Property Value
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.
Defined in
LayoutStageBase.enabledGets or sets the stop duration that this bundling algorithm is allowed to run.
Property Value
Throws
- Exception ({ name: 'ArgumentError' })
- if the specified duration has a negative value
Default Value
Gets or sets the strategy for bundling the edges.
Property Value
Default Value
Methods
Implementation of the ILayoutAlgorithm interface and main entry point for the layout calculation.
Parameters
- graph: LayoutGraph
- The graph to apply the layout to.