User-flow sankey

A user-flow diagram can show the destinations available after a step such as onboarding. It separates the question of where a user can go from the question of how many users took each path. The screenshot is from Fission's chart gallery.

What the chart is for

This example shows the first question only. SankeySeries currently has unweighted edges and equal-width bands, so the picture does not communicate conversion rates or drop-off. Keep those counts in a table or another quantitative chart.

Data model

Represent each stage by a stable ID and readable label; connect stages with GraphEdge source and target IDs. The current layout uses source and target columns, so this focused example uses a single branching step rather than implying a full multi-stage funnel.

Rust API

Setting
Type
Meaning
SankeySeries::nodes
Vec<GraphNode>
Supplies identified and named nodes.
SankeySeries::edges
Vec<GraphEdge>
Connects source IDs to target IDs.
Chart::series
Vec<Series>
Adds the relationship series without Cartesian axes.
GraphEdge is imported from fission::charts::series::graph.

Example

use fission::charts::{Chart, GraphNode, SankeySeries};
use fission::charts::series::graph::GraphEdge;

let relationships = SankeySeries::new("Onboarding routes")
    .nodes(vec![
        GraphNode {
            id: "onboarding".into(),
            name: "Onboarding".into(),
            value: 1.0,
        },
        GraphNode {
            id: "workspace".into(),
            name: "Workspace".into(),
            value: 1.0,
        },
        GraphNode {
            id: "help".into(),
            name: "Help".into(),
            value: 1.0,
        },
    ])
    .edges(vec![
        GraphEdge {
            source: "onboarding".into(),
            target: "workspace".into(),
        },
        GraphEdge {
            source: "onboarding".into(),
            target: "help".into(),
        },
    ]);

let chart = Chart::new()
    .title("Routes from onboarding")
    .series(vec![relationships.into()]);

Authoring from a Fission component

Prepare the records outside the build, then pass them as props. The component does not discover services or run network requests while constructing the chart.
use fission::prelude::*;
use fission::charts::{Chart, GraphNode, SankeySeries};
use fission::charts::series::graph::GraphEdge;

// The parent resolves display labels from its translation bundles.
fission_component! {
    pub UserFlowSankeyChart<()> {
        props {
            chart_title: String,
            series_label: String,
            nodes: Vec<GraphNode>,
            edges: Vec<GraphEdge>,
        }
    }
    view(graph, _state, _cx) =>
        Chart(
            title: Some(graph.chart_title.clone()),
            series: vec![SankeySeries::new(&graph.series_label)
                .nodes(graph.nodes.clone())
                .edges(graph.edges.clone())
                .into()],
        )
}

Testing and accessibility

Check that Help and Workspace remain distinct destinations after localisation or label changes. Test conversion calculations separately; neither equal bands nor node values demonstrate a 50/50 user split.
Give users a readable list of connections as well as the visual. If selecting a node opens details, dispatch that selection through a reducer and resolve it against the current records.
Tags: sankey, flow.