Load grid visual map

A load grid compares worker pools on the same timeline. Giving the colour mapping a fixed range means an idle pool and a busy pool cannot each appear fully loaded simply because their local maxima differ. The screenshot is from Fission's chart gallery.

What the chart is for

Use the zero-to-100 scale consistently and keep the unit in the title. High utilisation is a reason to inspect waiting work, not proof that a pool is failing. Queue depth and job latency provide the missing context.

Data model

Here, each cell is a pool's busy-worker time as a percentage of available worker time in an hour. Aggregate those quantities over the same interval before dividing. Averaging unrelated percentages can give the wrong answer when pool capacity changes.

Rust API

Setting
Type
Meaning
Chart::x_axis
Axis
Supplies the column categories.
Chart::y_axis
Axis
Supplies the row categories, not the cell-value range.
HeatmapSeries::data
Vec<(usize, usize, f32)>
Supplies the indexed cells and their values.
Chart::visual_map
VisualMap
Sets the numeric range used for colour.

Example

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

let chart = Chart::new()
    .title("Worker utilisation by pool and hour (%)")
    .x_axis(Axis::category(vec!["09:00", "10:00", "11:00"]))
    .y_axis(Axis::category(vec!["Imports", "Exports"]))
    .visual_map(VisualMap::new().min(0.0).max(100.0))
    .series(vec![HeatmapSeries::new("Utilisation (%)")
        .data(vec![
            (0, 0, 34.0),
            (1, 0, 72.0),
            (2, 0, 58.0),
            (0, 1, 41.0),
            (1, 1, 88.0),
            (2, 1, 95.0),
        ])
        .into()]);

Authoring from a Fission component

Pass the prepared samples into the component. Fetching, aggregation and failure handling stay outside the build; the component presents values already available to its parent.
use fission::prelude::*;
use fission::charts::{Axis, Chart, HeatmapSeries, VisualMap};

// The parent resolves display labels from its translation bundles.
fission_component! {
    pub LoadGridVisualMapChart<()> {
        props {
            chart_title: String,
            series_label: String,
            column_labels: Vec<String>,
            row_labels: Vec<String>,
            samples: 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(100.0)),
            series: vec![HeatmapSeries::new(&chart.series_label)
                .data(chart.samples.clone())
                .into()],
        )
}

Testing and accessibility

Check changing worker counts, a completely idle pool and missing measurements. Verify the ratio against the underlying busy and available durations rather than testing only the resulting colours. Provide readable values beside the visual, and check the category labels at the actual dashboard width.
Tags: visualMap, heatmap.