Energy balance sankey

An energy-balance view needs to distinguish useful output from losses. The connections are straightforward to draw, but the claim that band width represents transferred energy requires a weighted-flow model. The screenshot is from Fission's chart gallery.

What the chart is for

The current SankeySeries has no per-edge weight and draws equal-width bands. This example shows the routes from supply to output and losses; it is not a quantitative energy balance. Put the actual amounts in an accompanying table.

Data model

Supply GraphNode records and GraphEdge endpoint pairs. Unit node values are deliberate here: changing a node value does not produce a proportional band width in the current renderer.

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("Routes")
    .nodes(vec![
        GraphNode {
            id: "supply".into(),
            name: "Supply".into(),
            value: 1.0,
        },
        GraphNode {
            id: "use".into(),
            name: "Useful output".into(),
            value: 1.0,
        },
        GraphNode {
            id: "loss".into(),
            name: "Losses".into(),
            value: 1.0,
        },
    ])
    .edges(vec![
        GraphEdge {
            source: "supply".into(),
            target: "use".into(),
        },
        GraphEdge {
            source: "supply".into(),
            target: "loss".into(),
        },
    ]);

let chart = Chart::new()
    .title("Energy routes — not proportional to volume")
    .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 EnergyBalanceSankeyChart<()> {
        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

Test source and destination resolution and verify the energy balance in the domain calculation. Do not use visual band widths to test conservation or compare loss with useful output.
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, energy.