A series as a field of dots: each column filled from the axis up to the curve, a dot's size and brightness saying how much of it lies under the curve (the area reads as the area under it); a range in the accent colour; a scrubbing marker with the value; control points on the axis that drag the curve live.
Labels in the mono (pixel) face.
Installation
Components are distributed as source. Copy it and what it depends on into your project, then change it as you need:
cargo run --release --bin amenui -- add dot_chart --to ../my-appFiles copied: src/widgets/dot_chart.rs, src/widgets/mod.rs
Usage
use amenui::widgets::{dot_chart};
fn view() -> El<Msg> {
let mut c = DotChart::default();
(c.cols, c.rows, c.pitch) = (28, 10, 7.0);
dot_chart("dc1", &c, Msg::Chart)
}API
| Functions | dot_chart |
|---|---|
| Props | key, chart (DotChart: knots, cols, rows, pitch, range, max, unit), msg. |
| Files | src/widgets/dot_chart.rs |
| Depends on | base |
| Response to fronts | nudge (a control: pushed as one piece by fronts, held and condensing at most to Look::legible_cap) |
| Recomposition | the value label does not recompose (it follows the pointer) |
Keyboard and accessibility
| States | rest, scrubbing (a marker and a label at the column under the pointer), dragging a control point (captured until release); focused, Left / Right move the marker, Up / Down change the control point nearest to it. |
|---|---|
| Keys and messages | msg(ChartMsg) for pointer moves, drags of control points and keys; the application calls DotChart::update with it. |
On the web every control is mirrored into the page as an element with its role and name, so screen readers and the browser's own focus see it (DESIGN.md §1.14).
Recipes: A dot chart