Heatmap
A grid of colored cells, drawn as one image that fills its box.
GUITUIRuns in the browser
heatmapPreview




Usage example
fn heatmap_demo() -> NodeBuilder { container() .layout(LayoutStyle::flex_column().width(240.0).height(120.0)) .child(heatmap(12, 6, |x, y| Rgba8 { r: 40, g: u8::try_from(40 + x * 16).unwrap_or(u8::MAX), b: u8::try_from(80 + y * 28).unwrap_or(u8::MAX), a: 255, }))}fn heatmap_demo() -> NodeBuilder { container() .layout( LayoutStyle::flex_column() .width(240.0) .height(120.0), ) .child(heatmap(12, 6, |x, y| { Rgba8 { r: 40, g: u8::try_from(40 + x * 16) .unwrap_or(u8::MAX), b: u8::try_from(80 + y * 28) .unwrap_or(u8::MAX), a: 255, } }))}API
| Name | Signature | Purpose |
|---|---|---|
heatmap | fn heatmap<F: Fn(usize, usize) -> Rgba8>(grid_w, grid_h, color: F) -> NodeBuilder | A grid of colored cells, drawn as one image that fills its box. |