## Plotapi, beautiful by default.

Let plotapi do the heavy lifting – enabling beautiful interactive visualisations with a single line of code (instead of hundreds).

# Vertical Terminus Diagram

Contents

You can create beautiful, interactive, and engaging visualisations like this one with Plotapi in any programming language.

## Preamble¶

In [ ]:
from plotapi import Terminus

Terminus.set_license("your username", "your license key")

## Introduction¶

Let's take a look at the vertical property of the Terminus diagram. Using it can give the impression that the particles are "falling" through the pipes.

As we can see, we have set our license details in the preamble with Terminus.set_license().

## Dataset¶

Terminus expects a list of dictionary items, these will define the flow of pixels between a source and a target.

In [ ]:
links = [
{"source":"England", "target":"Germany", "value": 1000},
{"source":"England", "target":"France", "value": 3000},
{"source":"England", "target":"Spain", "value": 5000},
{"source":"England", "target":"Italy", "value": 4000},
{"source":"England", "target":"Japan", "value": 800},

{"source":"Ireland", "target":"Germany", "value": 3500},
{"source":"Ireland", "target":"France", "value": 3750},
{"source":"Ireland", "target":"Spain", "value": 1750},
{"source":"Ireland", "target":"Italy", "value": 5000},
{"source":"Ireland", "target":"Japan", "value": 400},
]

We can add many source's and target's! As they increase, we may need to adjust Terminus layout properties to accomodate the diagram's size and throughput.

## Visualisation¶

To produce a vertical Terminus diagram, we simply set vertical=True.

A vertical Terminus diagram is more suited to a portrait container, so we'll also set our width and height to improve the presentation.

Here we're using .show() which outputs to a Jupyter Notebook cell, however, we may want to output to an HTML file with .to_html() instead. More on the different output methods later!

In [3]:
Terminus(links, vertical=True, width=400, height=600).show()
Plotapi - Terminus Diagram

You can do so much more than what's presented in this example, and this is covered in other sections. If you want to see the full list of growing features, check out the Plotapi API Documentation.