Expand description
The domain-agnostic graph model — the same shape nornir’s
src/viz/graph_render.rs::draw_graph accepts, so this engine is a future
drop-in for that egui routine. Nodes are laid out in world space by the
caller (each domain owns its own layout/columns); edges reference nodes by
id. Decorations is the caller-supplied overlay — facett mustn’t know
what a “release gate” is, so rings/badges/emphasis-edges are opaque here.
Colours are a tiny POD Color (premultiply-free sRGBA8) with a From
conversion off egui’s Color32, so a caller already speaking egui (exactly
nornir’s draw_graph) maps straight across with zero glue.
Structs§
- Camera
- The camera transform: pan + zoom over the world. World point
pprojects to screen ascenter + pan + p * zoom(the same affine nornir’sdraw_graphapplies). Owned by the caller so navigation survives across frames. - Color
- A straight sRGBA8 colour (NOT premultiplied). The render backends convert to their own colour type at the seam.
- Decorations
- The caller-supplied overlay layer (domain-agnostic). Per-node rings/badges keyed by node id, plus extra emphasis edges painted on top (e.g. a cycle’s suggested cut). Empty = no overlay.
- Graph
Edge - One edge: endpoints by node id, colour, a
dashedflag, and an optional mid-edge label (a cut rationale). - Graph
Model - The full graph to paint — nodes (laid out) + edges.
- Graph
Node - One laid-out node: stable id, label, chip fill + stroke (the kind colour, caller’s choice), and its world-space centre.
- Node
Decoration - A per-node decoration layered over the base chip: an optional status ring
colour (drawn outside the kind stroke), an optional badge (a short glyph/text
at the chip’s top-right corner), and an optional scale — a multiplier on the
node’s marker radius so a caller can size nodes by an importance metric
(population, degree, …) without the engine learning what the metric means. The
L0 lowering reads
scale(default1.0) when it sizes the node marker. - Pos
- A 2D point in world space (caller-owned layout coordinates).