facett-cfd — design note
Status: builds (egui 0.33 + chrono) + 2 tests green. In ordning/crates/widgets/facett-cfd; destined for facett.
What it is
A Cumulative Flow Diagram: stacked status areas over time — band widths = how many cases in each status, a widening band = a growing bottleneck, top slope = throughput, horizontal distance across bands ≈ cycle time. Fed by daily status snapshots (free from the event log).
API
let mut c = Cfd::new("Flow", vec![Band::new("todo","To do"), Band::new("doing","Doing"), Band::new("done","Done")]);
c.set_series(vec![ Snapshot{ date, counts: {"todo":8,"doing":1,"done":0} }, … ]); // any order; sorted internally
c.ui(ui);
Design decisions
- Drawn as filled quads between consecutive snapshots per band (each quad convex → robust egui
convex_polygon); proper stacked areas, not discrete bars. - Series sorted by date defensively; needs ≥2 snapshots (shows a hint otherwise).
- Default cool→warm color ramp by band index (override per band); legend rendered.
state_jsonexposes bands, snapshot count, max_total, range, and the latest snapshot totals.
Move-to-facett / TODO
- Theme the ramp from
facett_core::theme()sequential palette. -
Add hover-readout (counts at a date), cycle-time/WIP annotations, and the companion aging-WIP
- cycle-time scatterplot facets (the rest of the flow-metrics set in manual ch.13).