logo

G6

  • Docs
  • API
  • Playground
  • Community
  • Productsantv logo arrow
  • 5.0.47
  • Introduction
  • Data
  • Getting Started
    • Quick Start
    • Installation
    • Integration
      • react
      • vue
      • angular
    • Step-by-step guide
  • Graph
    • Extensions En
    • Graph
    • Options
    • extension
  • Element
    • Element Overview
    • Element State
    • Node
      • Node Overview
      • Build-in Node
        • Common Node Configurations
        • Diamond
        • Donut
        • Ellipse
        • Hexagon
        • Html
        • Image
        • Rect
        • Star
        • Triangle
        • Circle
      • Custom Node
      • Define Nodes with React
    • Edge
      • Edge Overview
      • Build-in Edge
        • Common Edge Configurations
        • Cubic Bezier Curve
        • CubicHorizontal Bezier Curve
        • CubicVertical Bezier Curve
        • Line
        • Polyline
        • Quadratic Bezier Curve
      • Custom Edge
    • Combo
      • Combo Overview
      • Build-in Combo
        • Circle
        • Combo Configuration Options
        • Rect
      • Custom Combo
    • Shape
      • Shape and KeyShape
      • Atomic Shapes and Their Properties
      • Design and Implementation of Composite Shape
  • Layout
    • Layout Overview
    • Build-in Layout
      • 3D Force-Directed Layout
      • AntvDagre Layout
      • Circular Layout
      • ComboCombined Layout
      • Common Layout Configuration Options
      • CompactBox
      • Concentric Layout
      • D3 Force-Directed Layout
      • Dagre Layout
      • Dendrogram Layout
      • Fishbone Layout
      • Force Force-directed Layout
      • ForceAtlas2 Force-directed Layout
      • Fruchterman Force-directed Layout
      • Grid Layout
      • Indented Tree
      • MDS High-dimensional Data Dimensionality Reduction Layout
      • Mindmap Tree
      • Radial Layout
      • Random Layout
      • Snake Layout
    • Custom Layout
  • Behavior
    • Behavior Overview
    • Build-in Behavior
      • AutoAdaptLabel
      • BrushSelect
      • ClickSelect
      • CollapseExpand
      • CreateEdge
      • DragCanvas
      • DragElement
      • DragElementForce
      • FixElementSize
      • FocusElement
      • HoverActivate
      • LassoSelect
      • OptimizeViewportTransform
      • ScrollCanvas
      • ZoomCanvas
    • Custom Behavior
  • Plugin
    • Plugin Overview
    • Build-in Plugin
      • Background
      • BubbleSets
      • Contextmenu
      • EdgeBundling
      • EdgeFilterLens
      • Fisheye
      • Fullscreen
      • GridLine
      • History
      • Hull
      • Legend
      • Minimap
      • Snapline
      • Timebar
      • Toolbar
      • Tooltip
      • Watermark
    • Custom Plugin
  • Transform
    • Data Transformation Overview
    • Build-in Transform
      • MapNodeSize
      • PlaceRadialLabels
      • ProcessParallelEdges
    • Custom Transform
  • Theme
    • Theme Overview
    • Custom Theme
    • Palette
    • Custom Palette
  • Animation
    • Animation Overview
    • Custom Animation
  • Further Reading
    • Event
    • renderer
    • coordinate
    • download-image
    • Using Iconfont
    • Use 3D
    • Bundle Project
  • What's new
    • Feature
    • Upgrade To 5.0
  • FAQ
  • contribute

EdgeBundling

Previous
Contextmenu
Next
EdgeFilterLens

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Overview

Edge bundling is a graph visualization technique used to reduce visual clutter in complex network graphs and to reveal high-level patterns and structures in the graph. Its purpose is to bundle adjacent edges together.

The edge bundling plugin provided in G6 is based on the implementation of the FEDB (Force-Directed Edge Bundling for Graph Visualization) paper: modeling edges as flexible springs that can attract each other and bundling them through a self-organizing process.

Use Cases

The edge bundling plugin is mainly suitable for the following scenarios:

  • Reducing visual clutter in complex network graphs
  • Revealing high-level patterns and structures in the graph
  • Improving the readability and aesthetics of large-scale graph data

Basic Usage

Below is a simple example of initializing the EdgeBundling plugin:

const graph = new Graph({
plugins: [
{
type: 'edge-bundling',
bundleThreshold: 0.6,
cycles: 6,
divisions: 3,
divRate: 2,
iterations: 90,
iterRate: 2 / 3,
K: 0.1,
lambda: 0.1,
},
],
});

Configuration Options

PropertyDescriptionTypeDefault ValueRequired
typePlugin type, used to identify the plugin as an edge bundling pluginstringedge-bundling✓
keyUnique identifier for the plugin, can be used to get the plugin instance or update plugin optionsstring-
bundleThresholdEdge compatibility threshold, determines which edges should be bundled together, the larger the value, the fewer edges are bundled, examplenumber0.6
cyclesNumber of simulation cycles, controls the number of execution rounds of the edge bundling simulationnumber6
divisionsInitial number of cut points, in subsequent cycles, the number of cut points will gradually increase according to divRate, affecting the degree of edge subdivisionnumber1
divRateGrowth rate of cut points, determines the growth rate of cut points in each cyclenumber2
iterationsSpecifies the number of iterations executed in the first cycle, in subsequent cycles, the number of iterations will gradually decrease according to iterRate, affecting the accuracy of the simulationnumber90
iterRateIteration decrement rate, controls the reduction ratio of iterations in each cyclenumber2/3
KEdge strength, affects the attraction and repulsion between edges, examplenumber0.1
lambdaInitial step size, in subsequent cycles, the step size will double increment, affecting the magnitude of node movement during edge bundlingnumber0.1

bundleThreshold

Edge compatibility threshold, determines which edges should be bundled together. The larger the value, the fewer edges are bundled, and vice versa.

  • A lower bundleThreshold value (e.g., 0.4) will cause more edges to be bundled together, forming a more pronounced bundling effect.
const graph = new Graph({
plugins: [
{
type: 'edge-bundling',
bundleThreshold: 0.4, // Lower edge compatibility threshold
},
],
});

The effect is as follows: Lower edge compatibility threshold

  • A higher bundleThreshold value (e.g., 0.8) will cause fewer edges to be bundled together, maintaining more independent edges.
const graph = new Graph({
plugins: [
{
type: 'edge-bundling',
bundleThreshold: 0.8, // Higher edge compatibility threshold
},
],
});

The effect is as follows: Higher edge compatibility threshold

K

Edge strength, affects the attraction and repulsion between edges. A higher K value will make the attraction between edges stronger, resulting in a tighter bundling effect.

  • A lower K value (e.g., 0.05) will make the attraction between edges weaker, resulting in a weaker bundling effect.
const graph = new Graph({
plugins: [
{
type: 'edge-bundling',
K: 0.05, // Lower edge strength
},
],
});

The effect is as follows: Lower edge strength

  • A higher K value (e.g., 0.2) will make the attraction between edges stronger, resulting in a more pronounced bundling effect.
const graph = new Graph({
plugins: [
{
type: 'edge-bundling',
K: 0.2, // Higher edge strength
},
],
});

The effect is as follows: Higher edge strength

Code Examples

Basic Edge Bundling

The simplest way is to use the preset configuration directly:

const graph = new Graph({
// Other configurations...
plugins: ['edge-bundling'],
});

Custom Styles

You can customize the parameters of edge bundling as needed:

const graph = new Graph({
// Other configurations...
plugins: [
{
type: 'edge-bundling',
bundleThreshold: 0.8, // Higher edge compatibility threshold
cycles: 8, // More simulation cycles
K: 0.2, // Stronger edge strength
},
],
});

Dynamic Update of Edge Bundling

Use the key identifier to dynamically update edge bundling properties at runtime:

// Initial configuration
const graph = new Graph({
// Other configurations...
plugins: [
{
type: 'edge-bundling',
key: 'my-edge-bundling',
bundleThreshold: 0.6,
},
],
});
// Subsequent dynamic update
graph.updatePlugin({
key: 'my-edge-bundling',
bundleThreshold: 0.8, // Update edge compatibility threshold
cycles: 10, // Update number of simulation cycles
});

Practical Examples