Transition Graph
Displays an interactive directed graph where nodes are unique events and edges represent transitions between them. Edge weights can show transition probabilities, counts, or time-based metrics. Supports diff mode to compare two user segments side by side.
Usage
stream.transition_graph()
stream.transition_graph(edge_weight="count", diff=("plan", "pro", "free"))
Parameters
Data
Data parameters change the computed result. They are exactly the arguments of
the widget's headless twin stream.transition_graph_data() — see
headless mode below.
| Parameter | Type | Description |
|---|---|---|
edge_weight | {"proba_out", "proba_in", "count", "unique_paths", "share_of_total", "avg_per_path", "time_median", "time_q95"}, default "proba_out" | Value shown on edges. See the Edge Weights section for more details. |
diff | tuple, optional | (segment_col, value1, value2) or (path_ids1, path_ids2); value2 may be <REST>, meaning "every other value of segment_col". |
path_col | str, optional | Path ID column override; defaults to schema.path_col. |
Display
Display parameters only affect how the widget is rendered.
| Parameter | Type | Description |
|---|---|---|
height | int, default 500 | Widget height in pixels. |
sidebar_open | bool, default True | Whether the sidebar starts open. |
Edge weights
"proba_out"— probability of the transition among all transitions out of the source event."proba_in"— probability of the transition among all transitions into the target event."count"— number of times the transition occurred."unique_paths"— number of distinct paths containing the transition."share_of_total"— share of this transition among all transitions in the eventstream."avg_per_path"— average number of occurrences per path."time_median"/"time_q95"— median / 95th-percentile time between the two events (in seconds).
Headless mode
stream.transition_graph_data()
Compute the transition matrix between events (headless): an
events x events DataFrame where cell [source, target] holds the selected
edge_weight for the source -> target transition. This is the data
behind the transition_graph widget.
Examples
Basic
stream.transition_graph()
Edge weight
stream.transition_graph(edge_weight="unique_paths")
Diff mode
stream.transition_graph(diff=["platform", "mobile", "desktop"])