public class EdgeBundling extends Object
EdgeBundling
instance defines if and how the edges of a graph should be bundled by a
layout algorithm
, given that the algorithm supports edge bundling.
Bundling together multiple edges means that their common parts are to some degree merged into a bundled part. At the source and target point, the edges are again clearly split. Edge bundling is useful to increase the readability of graph drawings with a high number of edges that connect a comparably small number of nodes. Without bundling, such drawings can often contain visual clutter and feature bad readability.
The bundling strength
and quality
are global settings for
the bundling process. On the other hand, each edge can get specific settings by assigning a EdgeBundleDescriptor
to it. A IDataProvider
can be registered with the input graph with key EDGE_BUNDLE_DESCRIPTOR_DPKEY
to assign descriptors to edges. This allows, for example, to define which edges should actually be bundled.
CircularLayout
, RadialLayout
and TreeReductionStage
(only for graphs that do not contain multi-parent
structures) support edge bundling. The edge bundling can be specified by means of method
EdgeBundling
, EdgeBundling
and EdgeBundling
, respectively.
Example of edge bundling with CircularLayout
Example of edge bundling when applying TreeReductionStage
and BalloonLayout
on a general graphEdgeBundleDescriptor
,
CircularLayout.getEdgeBundling()
Modifier and Type | Field and Description |
---|---|
static EdgeDpKey<EdgeBundleDescriptor> |
EDGE_BUNDLE_DESCRIPTOR_DPKEY
A
DataProvider key for specifying individual bundling settings for edges
If no EdgeBundleDescriptor is mapped to an edge, the default descriptor is
used by the layout algorithm to obtain the bundling setup of that edge. |
Constructor and Description |
---|
EdgeBundling()
Creates a new
EdgeBundling instance with default settings. |
EdgeBundling(double bundlingStrength,
double bundlingQuality)
|
Modifier and Type | Method and Description |
---|---|
double |
getBundlingQuality()
Gets the desired quality of the calculated edge bundling.
|
double |
getBundlingStrength()
Gets the strength of the edge bundling.
|
EdgeBundleDescriptor |
getDefaultBundleDescriptor()
Gets the default
EdgeBundleDescriptor used for all edges which do not have a specific descriptor assigned via a
IDataProvider registered with key EDGE_BUNDLE_DESCRIPTOR_DPKEY . |
void |
setBundlingQuality(double value)
Sets the desired quality of the calculated edge bundling.
|
void |
setBundlingStrength(double value)
Sets the strength of the edge bundling.
|
void |
setDefaultBundleDescriptor(EdgeBundleDescriptor value)
Sets the default
EdgeBundleDescriptor used for all edges which do not have a specific descriptor assigned via a
IDataProvider registered with key EDGE_BUNDLE_DESCRIPTOR_DPKEY . |
public static final EdgeDpKey<EdgeBundleDescriptor> EDGE_BUNDLE_DESCRIPTOR_DPKEY
DataProvider
key for specifying individual bundling settings for edges
If no EdgeBundleDescriptor
is mapped to an edge, the default descriptor
is
used by the layout algorithm to obtain the bundling setup of that edge.
getDefaultBundleDescriptor()
public EdgeBundling()
EdgeBundling
instance with default settings.public EdgeBundling(double bundlingStrength, double bundlingQuality)
IllegalArgumentException
- if the given bundling strength or quality is not within [0,1]
bundlingStrength
- the bundling strength from the interval [0,1]
bundlingQuality
- the bundling quality from the interval [0,1]
public double getBundlingQuality()
Higher quality indicates that the bundling procedure uses more sophisticated methods to compute the actual bundles and the routing of the edges. This may lead to a significantly higher running time, especially for large graphs. On the other hand, a low quality indicates that run-time is more important than highly optimized bundling results, leading to, for example, more crossings between different bundles.
The quality is defined to lie within [0,1]
, where higher values stand for higher quality.
IllegalArgumentException
- if the given quality value is not within [0,1]
CircularLayout
.0
(low quality, fast) and 1
(high quality, slow)setBundlingQuality(double)
public double getBundlingStrength()
The strength controls how tightly the edges are bundled and influences the shape of the curves of bundled edges. Low values lead to only slightly bundled edges; results will mostly show individual node-to-node connectivity information. High values show the connectivity on a higher level, strongly bundling edges together and generating highly curved edge paths.
The bundling strength is defined as a value from the interval [0,1]
.
IllegalArgumentException
- if the given strength is less than 0
or greater than 1
0.8
or
higher.0
leads to straight-line edges where edges are basically not bundled.0
(no bundling) and 1
(strongly bundled edges).setBundlingStrength(double)
public EdgeBundleDescriptor getDefaultBundleDescriptor()
EdgeBundleDescriptor
used for all edges which do not have a specific descriptor assigned via a
IDataProvider
registered with key EDGE_BUNDLE_DESCRIPTOR_DPKEY
.IllegalArgumentException
- if the given descriptor is null
EdgeBundleDescriptor
EDGE_BUNDLE_DESCRIPTOR_DPKEY
,
setDefaultBundleDescriptor(EdgeBundleDescriptor)
public void setBundlingQuality(double value)
Higher quality indicates that the bundling procedure uses more sophisticated methods to compute the actual bundles and the routing of the edges. This may lead to a significantly higher running time, especially for large graphs. On the other hand, a low quality indicates that run-time is more important than highly optimized bundling results, leading to, for example, more crossings between different bundles.
The quality is defined to lie within [0,1]
, where higher values stand for higher quality.
IllegalArgumentException
- if the given quality value is not within [0,1]
CircularLayout
.value
- a value between 0
(low quality, fast) and 1
(high quality, slow)getBundlingQuality()
public void setBundlingStrength(double value)
The strength controls how tightly the edges are bundled and influences the shape of the curves of bundled edges. Low values lead to only slightly bundled edges; results will mostly show individual node-to-node connectivity information. High values show the connectivity on a higher level, strongly bundling edges together and generating highly curved edge paths.
The bundling strength is defined as a value from the interval [0,1]
.
IllegalArgumentException
- if the given strength is less than 0
or greater than 1
0.8
or
higher.0
leads to straight-line edges where edges are basically not bundled.value
- the bundling strength between 0
(no bundling) and 1
(strongly bundled edges).getBundlingStrength()
public void setDefaultBundleDescriptor(EdgeBundleDescriptor value)
EdgeBundleDescriptor
used for all edges which do not have a specific descriptor assigned via a
IDataProvider
registered with key EDGE_BUNDLE_DESCRIPTOR_DPKEY
.IllegalArgumentException
- if the given descriptor is null
EdgeBundleDescriptor
value
- the default descriptor responsible for edges with no specific descriptorEDGE_BUNDLE_DESCRIPTOR_DPKEY
,
getDefaultBundleDescriptor()