Small matrix heatmap

A small heatmap compares the same measure across two sets of categories. Here, the categories are days and shifts; the measure is the number of jobs waiting. This makes a busy shift visible without giving each shift its own chart. The screenshot is from Fission's chart gallery.

What the chart is for

The useful property of a matrix is that a cell has a fixed meaning: one day, one shift, one queue size. Keep that meaning consistent across the matrix. If a user needs to read every queue size rather than locate the busy shifts, use a table instead.

Data model

HeatmapSeries takes (x_index, y_index, value) triples. The indices refer to the category lists, not to the labels themselves. For example, (1, 0, 8.0) means eight queued jobs on Tuesday's morning shift. An omitted cell is not an explicit zero; include a zero-valued sample when that is what the source records.

Rust API

Field
Type
Notes
title
&str
Names the chart for the screen, accessibility tree, and test output.
x_axis
Axis
Usually Axis::category; use Axis::value() when x positions are numeric.
y_axis
Axis
Uses shift categories here; the third value in each triple supplies the cell intensity.
series
Series
Provides the typed data model for this chart family.
width / height
f32
Optional fixed size; omit them when the chart should flex inside Fission layout.

Example

use fission::charts::{Axis, Chart, HeatmapSeries, VisualMap};

let chart = Chart::new()
    .title("Queued jobs by day and shift")
    .x_axis(Axis::category(vec!["Mon", "Tue", "Wed"]))
    .y_axis(Axis::category(vec!["AM", "PM"]))
    .visual_map(VisualMap::new().min(0.0).max(10.0))
    .series(vec![HeatmapSeries::new("Queued jobs")
        .data(vec![
            (0, 0, 3.0),
            (1, 0, 8.0),
            (2, 1, 5.0),
        ])
        .into()]);

Interaction and animation

Only add interaction when it helps the user. Fission emits typed ChartInteractionEvent values for hover, press, release, scroll, selection, and brush actions; handle them in a reducer. Use ChartAnimation to set duration, delay, stagger, easing, and reduced-motion behavior. Those settings stay visible and testable.

Testing guidance

Test that your data maps to the series you expect. If you change how the chart is built or rendered, capture a live screenshot. To refresh the gallery image, run the ignored chart-gallery screenshot test with FISSION_UPDATE_CHART_DOCS=1; it updates docs2/site/assets/img/charts before the static-site build.

Authoring from a Fission component

Add the chart to any Fission layout, including a Card, Grid, Scroll, or responsive section.
use fission::prelude::*;
use fission::charts::{Axis, Chart, HeatmapSeries, VisualMap};

// The parent resolves display labels from its translation bundles.
fission_component! {
    pub SmallMatrixHeatmapChart<()> {
        props {
            chart_title: String,
            series_label: String,
            column_labels: Vec<String>,
            row_labels: Vec<String>,
            queued_jobs: Vec<(usize, usize, f32)>,
        }
    }
    view(chart, _state, _cx) =>
        Chart(
            title: Some(chart.chart_title.clone()),
            x_axis: Some(Axis::category(
                chart.column_labels.iter().map(String::as_str).collect(),
            )),
            y_axis: Some(Axis::category(
                chart.row_labels.iter().map(String::as_str).collect(),
            )),
            visual_map: Some(VisualMap::new().min(0.0).max(10.0)),
            series: vec![HeatmapSeries::new(&chart.series_label)
                .data(chart.queued_jobs.clone())
                .into()],
        )
}
Load the data before building the chart. Put the request or other async work in a reducer, job, service, or server route, then read the result from state in the component.

Options, accessibility, and diagnostics

Area
What to decide
How to check it
Data shape
Keep source rows in typed Rust structs, then map them into the series shown above.
Test that mapping separately from chart rendering.
Options
Pick axes, legends, labels, motion, and interaction to answer the screen's question.
Add a screenshot test when the chart's appearance changes.
Accessibility
Give the chart a clear title and explain important values in nearby text. Do not rely on color alone.
Inspect its semantics and check that the chart still makes sense without color.
Failure handling
Show a loading, empty, or error state when the data is not ready.
Test empty data, partial data, and a failed fetch.
Performance
Summarize or window very large datasets; keep the full history in your data layer.
Profile frame time and interaction latency with representative data.
Tags: heatmap, matrix.