In a chord diagram (or radial network), entities are arranged radially as segments with their relationships visualised by arcs that connect them. The size of the segments illustrates the numerical proportions, whilst the size of the arc illustrates the significance of the relationships .

Chord diagrams are useful when trying to convey relationships between different entities, and they can be beautiful and eye-catching.

Get Chord Pro¶

Click here to get lifetime access to the full-featured chord visualization API, producing beautiful interactive visualizations, e.g. those featured on the front page of Reddit.

Produce beautiful interactive Chord diagrams.

Customize colours and font-sizes.

Access Divided mode, enabling two sides to your diagram.

Symmetric and Asymmetric modes,

Add images and text on hover,

Access finer-customisations including HTML injection.

Allows commercial use without open source requirement.

Currently supports Python, JavaScript, and Rust, with many more to come (accepting requests).

The Chord Package¶

With Python in mind, there are many libraries available for creating Chord diagrams, such as Plotly, Bokeh, and a few that are lesser-known. However, I wanted to use the implementation from d3 because it can be customised to be highly interactive and to look beautiful.

I couldn't find anything that ticked all the boxes, so I made a wrapper around d3-chord myself. It took some time to get it working, but I wanted to hide away everything behind a single constructor and method call. The tricky part was enabling multiple chord diagrams on the same page, and then loading resources in a way that would support Jupyter Notebooks.

You can get the package either from PyPi using pip install chord or from the GitHub repository. With your processed data, you should be able to plot something beautiful with just a single line, Chord(data, names).show() . To enable the pro features of the chord package, get Chord Pro.

The Chord Crate¶

I wasn't able to find any Rust crates for plotting chord diagrams, so I ported my own from Python to Rust.