Lead flow sankey

A lead-flow diagram can describe how a qualified enquiry is routed to sales or to further nurturing. The route model and the number of enquiries taking each route are separate facts. The screenshot is from Fission's chart gallery.

What the chart is for

This example shows the route model only. GraphEdge is not weighted, and the current Sankey renderer gives each band the same width. It therefore cannot communicate the relative number of leads or a conversion percentage.

Data model

Use stable IDs for the qualification stage and its destinations. SankeySeries takes those nodes and the source/target edges. Keep route counts in the source records or a quantitative chart rather than encoding them in an unsupported edge field.

Rust API

Setting
Type
Meaning
SankeySeries::nodes
Vec<GraphNode>
Supplies stable IDs and readable labels.
SankeySeries::edges
Vec<GraphEdge>
Connects source and target IDs.
Chart::series
Vec<Series>
Presents the relationship series without Cartesian axes.

Example

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

let routes = SankeySeries::new("Lead routes")
    .nodes(vec![
        GraphNode {
            id: "qualified".into(),
            name: "Qualified".into(),
            value: 1.0,
        },
        GraphNode {
            id: "sales".into(),
            name: "Sales review".into(),
            value: 1.0,
        },
        GraphNode {
            id: "nurture".into(),
            name: "Nurture".into(),
            value: 1.0,
        },
    ])
    .edges(vec![
        GraphEdge {
            source: "qualified".into(),
            target: "sales".into(),
        },
        GraphEdge {
            source: "qualified".into(),
            target: "nurture".into(),
        },
    ]);

let chart = Chart::new()
    .title("Routes after lead qualification")
    .series(vec![routes.into()]);

Authoring from a Fission component

Prepare the records before building the chart, then pass them into a presentation component. Loading and failure states belong to the parent workflow rather than an implicit request made during a build.
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 LeadFlowSankeyChart<()> {
        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 destination changes and unknown routes. Test any conversion or lead-count aggregate separately and expose exact counts beside the diagram when reviewing pipeline performance.
Provide a readable connection list as an alternative to tracing lines. If a selection opens details, dispatch it through a reducer and identify the record by its current stable ID.
Tags: sankey, flow.