Skip to main content

Crate facett_syschart

Crate facett_syschart 

Source
Expand description

facett-syschart — a system-map chart: a handful of free-positioned peer nodes (not a layered DAG) joined by edges, each carrying a badge (a count / status number) and, when selected, an inline expandable detail panel. Click a node to select it; its detail renders in a panel under the canvas. The host owns what a node’s detail is (a string here; richer hosts draw their own widgets after ui() keyed off SystemChart::selected).

This is the piece facett_core::draw/[facett_graph::GraphView] don’t cover — those paint a non-interactive Scene; DepGraphView is a layered DAG with a fixed deps/dependents drill-down. A “monitoring map” of a few peer systems (a PKI/OIDC/Nexus triangle, a service mesh) wants deterministic positions, a per-node badge, click-select, and a free-form detail panel — that’s SystemChart.

§FC-2 / FC-9 contract

Built on facett_core::Elm: the complete observable state lives in one serializable SysChartModel (state); every input is a Msg applied through the single mutation path update (FC-2); and view is a pure function of &self that paints and returns the Msgs the frame produced (FC-9). impl_facet_via_elm! writes the impl Facet bridge (for m in view(ui) { update(m) }). A headless driver (facett_core::harness) feeds a Vec<Msg> and snapshots state with no egui / no GPU.

Structs§

SysChartModel
The complete observable state (FC-1 / FC-3) of a SystemChart, in one serializable, round-trippable struct: every node + edge, the selection (keyed on the stable SysNode::id, FC-5, so reorder/insert/delete preserves it), and the canvas height. SystemChart::state hands back a &SysChartModel; a headless driver (facett_core::harness) snapshots it after feeding a Vec<Msg>.
SysEdge
An undirected link between two node ids.
SysNode
One system in the map. Positions are normalized (0.0..=1.0 of the canvas), so the layout is resolution-independent and deterministic — ideal for headless rendering and screenshots.
SystemChart
The system-map chart Facet: a tab title plus the complete observable SysChartModel. The FC-9 pure view reads it and the FC-2 update is the sole path that mutates it.

Enums§

Effect
Side work as data (FC-8). The syschart does no I/O — every Msg mutates only the in-memory SysChartModel — so this is uninhabited on purpose: the type-checked statement that SystemChart::update never asks the host to do anything.
Msg
A robot-/CLI-addressable control message — the named boundary a headless driver (or a host toolbar) drives the chart through, the same effect the canvas gestures produce. Applied by SystemChart::update; the pure view returns these (it never mutates self).