facett-gantt — design note
Status: builds (egui 0.33 + chrono) + 2 tests green (incl. critical-path). In ordning/crates/widgets/facett-gantt; destined for facett.
What it is
Tasks as bars over a time axis, one row each, with dependency arrows (blocks/depends-on), a progress fill, milestones (diamonds), and a critical-path highlight. Derives from the case's stage/task DAG (the funnel edges) + dates.
API
let mut g = Gantt::new("Bygglov", vec![
Task::new("utred","Utredning", start, end).progress(1.0),
Task::new("komm","Kommunicering", start, end).dep("utred").progress(0.5),
Task::new("beslut","Beslut", start, end).dep("komm"),
]).with_today(today);
if let Some(task_id) = g.ui(ui) { /* clicked */ }
let cp: Vec<String> = g.critical_path();
Design decisions
- Critical path = the dependency chain with the latest finish (a simple longest-finish proxy computed to a fixpoint over the DAG). Tasks on it render in warm red; exposed in
state_json. - Dependency arrows drawn dep-end → task-start (elbow routing).
- Progress as an inner fill; milestones as yellow diamonds; today as the yellow vertical line.
- Deterministic (host supplies today);
state_jsoncarries tasks/deps/progress/critical_path.
Move-to-facett / TODO
- Real CPM (forward/backward pass, slack/float) instead of the longest-finish proxy.
- Drag a bar to reschedule (host-validated); collapse groups; share the time-axis helper with timeline/calendar/cfd.