This page aims to describe what Hierarchical Edge Bundling is, and how to build a basic one using R and the ggraph library. Hierarchical edge bundling requires two inputs:



  • A hierarchical network structure, also called tree
  • An adjacency matrix that describes connections between some nodes of the tree

Hierarchical network data frame

Connections data frame


Let’s start by creating the hierarchic structure with R, which gives the edges between nodes. We often accompany it with a second data frame that gives characteristics for each nodes of the first data frame. Let’s build these 2 tables:


This is a network that has a specificity in its organisation. Thus, we can visualise it with the igraph or ggraph libraries quite easily, like describe in the network section of the gallery.


Now, let’s add a second input to our data: connections. Suppose that your nodes 18, 20 and 30 are connected to the nodes 19, 50 and 70 respectively. An obvious solution to represent this link could be to add a straight line (left). The hierarchical edge bundling method does almost that. But it curves the lines to make in sort it follows the edges of our structure (right). This method proposes a ‘tension’ parameters which controls how much we want to curve the lines.


This becomes really handy when you want to visualise a large amount of data. Instead to have a messy chart with hundreds of crossed lines, the flows become more obvious. Let’s try with more connections. Left chart displays straight lines (tension=0), right chart is use curved lines (tension = 0.9).

Here we are, that’s a good first hierarchical edge bundling visualisation! Now, go to the next level and learn how to custom this figure.




Make a search



Leave a Reply

Notify of