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

Flow Map

Signature

sp.flow_map(title, labels=None, *, edges_i=None, edges_j=None, edges_w=None, variant="arc", map="world", region=None, **kwargs) -> Chart

Aliases: sp.flow_map, sp.flowmap, sp.flow_map_chart, sp.geo_flow, sp.connection_map, sp.great_circle_map

Description

sp.flow_map() draws origin → destination flows between matched regions. labels names every node; edges_i / edges_j are index pairs into labels for each flow’s origin and destination (the same edge-list shape sankey() uses); edges_w is each flow’s magnitude, which sets line width. variant selects the curve style; map selects which registered geographic region set to draw; region optionally restricts drawing to one named group inside that set. All of this is read live from the same register/inventory system the rest of the framework uses — nothing below is hardcoded.

Variants

Region Sets

Parameters


Returns

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


Each flow bows outward along a quadratic curve, the classic “flight path” look — reads cleanly even when several flows share an endpoint, since they fan out instead of stacking on the same line.

Variant "arc"Aliases "arc" / "basic" / "default" / "curved" / "great_circle"Returns Chart
Preview

The direct-line reading: origin and destination joined by a plain segment, width still scaled to each flow’s magnitude.

Variant "straight"Aliases "straight" / "line" / "direct"Returns Chart
Preview

The arc plus real motion: a thin white dashed stroke rides on top of every flow, driven by a stroke-dashoffset @keyframes animation embedded right in the svg, so direction reads as travel instead of a static line (falls back to still when the viewer has prefers-reduced-motion on).

Variant "animated"Aliases "animated" / "dashed" / "moving" / "flow_dash"Returns Chart
Preview

Every flow becomes a real tapered band instead of a stroked line — wide at the origin, narrowing toward the destination, sampled along the same curve the arc variant bows through and offset perpendicular to it at each point. Reads like a river or a Sankey band laid over the map.

Variant "ribbon"Aliases "ribbon" / "tapered" / "band" / "river"Returns Chart
Preview

Not pairwise connections at all — a single ordered path through lats/lons, storm-track style, with field as the intensity at each point (wind speed, category, whatever the reader should read off the color). Every point gets its own marker on a low/mid/high color tier, and the most recent leg ends in a direction arrowhead. labels/edges_i/edges_j/edges_w are ignored for this variant.

Variant "track"Aliases "track" / "storm_track" / "path_track" / "hurricane"Returns Chart
Preview