Step Sankey
Displays a step-by-step Sankey diagram showing which events users experience at each ordinal position in their path. The horizontal axis represents step number, making it easy to see how paths diverge over time.
Each column sums to 1 in standard mode, while in diff mode columns sum to 0.
Step Sankey and Step Matrix visualise the same underlying data in different forms: Step Sankey as a flow diagram, Step Matrix as a heatmap table. Use whichever makes the pattern you are looking for easier to spot.
Usage
stream.step_sankey(max_steps=15, path_pattern=".*->purchase->.*")
stream.step_sankey(diff=("country", "US", "<REST>"))
Parameters
Data
Data parameters change the computed result. They are exactly the arguments of
the widget's headless twin stream.step_sankey_data() — see
headless mode below.
| Parameter | Type | Description |
|---|---|---|
max_steps | int, default 10 | Number of path steps to compute. |
diff | tuple, optional | (segment_col, value1, value2) or (path_ids1, path_ids2); value2 may be <REST>. |
path_col | str, optional | Path ID column override; defaults to schema.path_col. |
path_pattern | str, optional | Same syntax as step_matrix's path_pattern. |
Display
Display parameters only affect how the widget is rendered.
| Parameter | Type | Description |
|---|---|---|
step_window | int, default 3 | Number of step columns shown around each anchor. |
height | int, default 500 | Widget height in pixels. |
sidebar_open | bool, default True | Whether the sidebar starts open. |
Headless mode
stream.step_sankey_data()
Compute per-step event-share matrices for Step Matrix / Step Sankey (headless).
Both widgets render the same underlying data — Step Matrix as a heatmap, Step Sankey as a flow diagram.
Examples
Basic
stream.step_sankey()
Path pattern
stream.step_sankey(path_pattern=".*->add_to_cart->.*->purchase->.*->path_end")
Diff mode
stream.step_sankey(diff=["platform", "mobile", "desktop"])