Visualizations Terminus
Pipe alignment
Pipes are aligned to the top-left by default, however, changing their alignment can often significantly improve the presentation of a Terminus diagram.
Sample data
Let's import PlotAPI and load our sample data.
from plotapi import Terminus
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},
]
Demonstration
The options available for pipe_alignment
are: top
, bottom
, justify
, and camel
.
Let's demonstrate pipe_alignment=camel
on a vertical Terminus diagram first, and then illustrate a few different configurations as PNGs.
Terminus(links, vertical=True, width=500, height=600,
pipe_color="#000000", pipe_opacity=0.1,
pipe_alignment="camel").show()
Terminus(links, vertical=True, width=500, height=600,
pipe_color="#000000", pipe_opacity=0.1,
pipe_alignment="bottom").show_png()
Terminus(links, pipe_color="#000000", pipe_opacity=0.1,
pipe_alignment="justify").show_png()
Terminus(links, pipe_color="#000000", pipe_opacity=0.1,
pipe_alignment="bottom").show_png()
Terminus(links, pipe_color="#000000", pipe_opacity=0.1,
pipe_alignment="middle").show_png()