Engaging plots, made easy.

Easily turn your data into engaging visualizations. Powerful API for coders. Powerful app for everyone.

main.py
notebook.ipynb
main.rs
from plotapi import Chord

Chord(matrix, names).show()

Visualizations Showcase

League of Legends Classes

In this notebook we're going to use PlotAPI Chord to visualise the co-occurrences between League of Legends classes. We"ll use Python, but PlotAPI can be used from any programming language.


Preamble

from plotapi import Chord
import json

Introduction

In this notebook we're going to use PlotAPI Chord to visualise the co-occurrences between League of Legends classes. We"ll use Python, but PlotAPI can be used from any programming language.

In a chord diagram (or radial network), entities are arranged radially as segments with their relationships visualised by ribbons 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.

Dataset

We're going to use League of Legends Champion data from version 11.15.1, a copy of which is available in this documentation website. Let"s get loading the data.

with open("lol_classes.json", "r") as f:
    data = json.load(f)
    
names = ['Assassin', 'Fighter', 'Mage', 'Marksman', 'Support', 'Tank']

Visualisation

Let's use PlotAPI Chord for this visualisation.

We're going to adjust some layout and template parameters, and flip the intro animation on too.

Because we're using a data-table, we can also click on any part of the diagram to "lock" the selection.

plot = Chord(
    data["matrix"],
    names,
    colors="league",
    details_thumbs=data["details_thumbs"],
    noun="Champions",
    thumbs_width=50,
    thumbs_margin=0,
    credit=True,
    padding=0.05,
    arc_numbers=True,
    width=560,
    margin=30,
    curved_labels=True,
    reverse_gradients=True,
    verb="appear together in",
    data_table=data["data_table"],
    data_table_column_width=130,
    data_table_show_indices=False,
)

Display inline

plot

Upload to cloud

With our plot created, let's upload it to PlotAPI cloud and get a shareable link.

plot.upload(
    name="League of Legends Class Combinations",
    description='''In this project we're going to use PlotPanel to visualise the co-occurrences between League of Legends classes. We're going to use League of Legends Champion data from version 12.4.1, a copy of which is available through the Riot Games API.''',
    maximized=True,
    public=True,
    custom_css=custom_css,
)
Your visualization has been uploaded successfully! You can view and share it at https://plotapi.com/explore/view/35156689-7032-4280-9e26-9b95e905c081.
Previous
Showcase