Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Arc Diagram

Signature

sp.arc_diagram(title, labels, edges_i, edges_j, edges_w, *, variant="basic", **kwargs) -> Chart

Aliases: sp.arc_diagram, sp.arc_chart, sp.arc_plot, sp.arc_graph, sp.linear_network

Description

Arc diagrams place nodes on a horizontal axis and draw quadratic bezier arcs above (and optionally below) the axis to represent connections. They are particularly effective for showing sequential or ordered relationships.

Variants

Data

labels (list[str]) — Node names. edges_i (list[int]) — Source node indices. edges_j (list[int]) — Target node indices. edges_w (list[float]) — Edge weights. width / height (int) — Chart dimensions.

Parameters

Themes

Returns

Chart — object with .html property and .show() method.

Arcs above the axis

Variant "basic"Aliases basic / default / classic
Preview

Alternating arcs above and below

Variant "bilateral"Aliases bilateral / both / dual
Preview

Stroke width proportional to edge weight

Variant "weighted"Aliases weighted / width / value
Preview

Thin, low-opacity arcs with small strokeless nodes — strips away the visual weight so overlapping arcs stay legible in dense diagrams.

Variant "minimal"Aliases minimal / thin / clean
Preview

Draws a small arrowhead where each arc lands on its target node — turns the diagram into a proper directed graph, e.g. for dependency or citation edges where "which way" matters as much as "how much".

Variant "directed"Aliases directed / arrows / flow / dependency
Preview