Expand description
facett-core — the visual kernel. Render a node/edge Scene into egui.
Source-agnostic: build a Scene from anything (Arrow rows, a graph, a DAG),
hand it here, get pixels. The CPU painter is the reference; a wgpu fast
path (GPU viewport-cull + indirect draw, seeded from katana-osm’s
osm-viewer) lands behind this same draw() call — consumers don’t change.
Re-exports§
pub use a11y::Semantics;pub use a11y::node as a11y_node;pub use a11y::stable_id;pub use errcode::FacetError;pub use errcode::MountedFacetError;pub use action_bus::ActionBus;pub use action_bus::BusAction;pub use action_bus::BusMsg;pub use caps::FacetCaps;pub use dragdrop::DragDrop;pub use dragdrop::DragEffect;pub use dragdrop::DragMsg;pub use dragdrop::Move as DragMove;pub use clip::ArrowColumnRef;pub use clip::ClipKind;pub use clip::ClipPayload;pub use clip::CopySource;pub use clip::PasteTarget;pub use clipboard::ClipAction;pub use deckfx::DeckFx;pub use deckfx::DeckRaven;pub use elm::Elm;pub use imgscan::BBox;pub use imgscan::Rgba;pub use imgscan::ScanReport;pub use imgscan::coverage;pub use imgscan::high_freq_ratio;pub use imgscan::painted_centroid_and_bbox;pub use imgscan::scan;pub use imgscan::spoke_score;pub use look::Action;pub use look::KeyMap;pub use look::Palette;pub use nav::Dir4;pub use nav::nearest_in_direction;pub use panel::Panel;pub use rabbit::Rabbit;pub use rabbit::RabbitMesh;pub use rabbit::rabbit_mesh;pub use rabbit::rabbit_outline;pub use scroll_engine::SmoothScroll;pub use severity::Severity;pub use severity::worst as worst_severity;pub use theme::Theme;pub use theme::set_theme;pub use theme::theme;pub use time_axis::TimeAxis;pub use time_axis::TimeEffect;pub use time_axis::TimeMsg;pub use look::Theme as LookTheme;
Modules§
- a11y
- facett-core::a11y — the FC-4 enabler. One helper that makes a custom-painted element appear in the AccessKit tree.
- action_
bus - The shared action bus (BUS-1) — a typed, deterministic outbox facets use
to hand side work (a drag move, a time-scrub, a command) to the host. The
common carrier
dragdrop/time_axisEffects flow through. Shared action bus (BUS-1) — the one typed, observable outbox facets use to hand side work to the host: a kanbandragdropmove, atime_axisscrub that should scroll linked facets, a toolbar command. It is the common carrier the two other primitives’Effects flow through on their way to the host. - barnes_
hut - Barnes–Hut N-body repulsion — the shared O(n log n) force-layout kernel
(dimension-generic quadtree/octree, gatling-parallel) that every facett
force-directed layout consumes so a 30 000-node graph lays out without the
O(n²)-per-iteration hang. See
barnes_hut. Barnes–Hut N-body repulsion — the shared, dimension-generic core that makes every facett force-directed layout scale past ~30 000 nodes. - caps
- Uniform capability model — every
Facetreturns a smallFacetCapsdescriptor so a host (theFacetDeck, korp, nornir) can treat all components uniformly: query “is this scalable?”, “copyable?”, “searchable?” without knowing the concrete type. See.nornir/design/capability-model.md. - chrome
- chrome — the shared glass / card decoration (Tier-1 §T1.3): a rounded
frame with an
effects::glow_rectedge over anoverlay::glass_tintfill, all gated by the activeEffectsPolicy. One call gives any panel the “frosted card” look that degrades gracefully: a soft glass card underFull/Reduced, a crisp opaque panel underNone/Device. - clip
- Cross-facet typed copy/paste (§16) — the trait + payload machinery so
copy/paste carries full typed data between facett components, not just
text. A process-wide transfer registry holds the last typed
ClipPayloadso a paste target gets the richest representation the source offered; on copy we also mirror Text/TSV to the OS clipboard for external apps. - clipboard
- Uniform clipboard — cut / copy / paste routed the same way for every
Facet. egui delivers the OS clipboard gesture as semantic events (egui::Event::Copy/Cut/Paste), which a focusedTextEditconsumes first — so a form field handles its own copy and the facet-levelcopyonly fires when the facet body is the clipboard target. The deck drains these events once per frame (poll) and makes the single OS-touching write (put); facets stay pure (copy/cutreturn the text). See.nornir/design/clipboard.md. - deckfx
- Deck-level effects + theming — wires the
themepalettes and theeffectsbloom/raven into theFacetDeckas opt-in, host-controllable features. - devid
- The UI error-code scheme (
facet-<component>-<n>) — the stable, unique code every facett UI part carries so tests + consumers react to the CODE, not a matched string. Seeerrcode::FacetError, thefacet_err!macro, the canonicalerrcode::REGISTRY, and the pinkerrcode::code_colorrenderer. The DEV-ID badge — every pane says who it is, in non-release builds only. - dragdrop
- The shared drag-and-drop primitive (DND-1) — the one reducer behind
items-dragged-onto-zones (cards→columns, bars→lanes). Engine-agnostic sibling
of
nav::Navigable; the caps flagFacetCaps::draggablepoints here. Shared drag-and-drop primitive (DND-1) — the one reducer behind every “drag an item onto a zone” facet: cards→columns (kanban), bars→lanes (gantt), files→folders, chips→buckets. Likenav::Navigableandscroll_engine::SmoothScroll, it is an engine-agnostic state machine — no egui, no rendering — so its transitions are a tested property (FC-7) and any host paints it however it likes. - edges
- Graph edge rendering (§18) — straight, spline (cubic Bézier / Catmull-Rom
sampled), and fat/soft (variable width, feathered) edges, with widths/softness
from the theme. Device = crisp hairlines, no glow (gated by
EffectsPolicy). The sampling is pure so the path is snapshot-stable. - effects
- effects — motion + bloom for the facett look. Pure egui, glow backend
only: everything here paints with layered alpha shapes on an
egui::Painter, so it works without a custom GPU shader. - elm
- The canonical Elm contract (FC-2 / FC-9) — the
Elmtrait +impl_facet_via_elm!bridge macro that liftfacett-security’s hand-rolled Model/Msg/Effect/pure-view pattern into reusable infra. Pair withharnessto drive anElmcomponent headlessly. The canonical Elm contract — the reusable scaffold behind FC-2 / FC-9. - engine
- THE unified view core (ENGINE-1) — the one cull · project · label-collide ·
pick spine that
facett-map,facett-map3d,facett-geomap, the L1 overlay and every graph view collapse onto. Only THREE things differ between a map and a graph, and they are the three traits (PositionSource,ElevationSource,Hierarchy). Seeengine. facett-core::engine — THE unified view core. - errcode
- facett-core::errcode — the STABLE, UNIQUE UI error-code scheme.
- focus
- Focus hints, pane revolver, and form groups (§13 FOC-3/FOC-4 + FORM-*).
All off-by-default, themed, and deterministic (no ambient time): the hint
labels are a pure function of the focusables; the revolver transform is a pure
function of
(progress, target, viewport); form navigation is pure rect geometry reusingnav::nearest_in_direction. Built on egui focus (Memory::request_focus/move_focus) at the call site. - harness
- Headless test harness — fire up a
Facet, inject data, render it offscreen, and capture what it drew: itsstate_json+ a vertex count (a “it drew something” proxy) + a stderr activity trail. No display, no GPU. This is the basis of facett’s auto test matrix, and mirrors nornir viz’sNORNIR_VIZ_STATEintrospection — every component is observable from outside. - imgscan
- imgscan — the reusable IMAGE-ANALYSIS oracle (SCAN-THE-PIXELS law).
- interface
- The APP SHAPE —
App/Interface/Infrastructure, the one runtime shape every workspace_nordisk suite app wears. - label_
grid - The label-declutter contract — the order-independent spatial-grid collision
rule shared by the CPU painter and the WGSL compute passes (GFX_V2 item 4). One
writer, two executions; see the module docs for why
legibility::place_labels(greedy, order-dependent, displaces into alternative slots) could not be the one. The label-declutter contract — ONE writer, two executions (GFX_V2 item 4). - labels3d
- 3D label “gyro” stabilization (§19) — fix labels bobbing while the scene rotates. The label’s 3D anchor is projected to screen space, then the text is drawn billboarded (upright, camera-facing) — never rotated with the scene (GYRO-1). Vertical jitter is eliminated by stable sub-pixel placement (consistent rounding) + optional temporal smoothing of the projected anchor (GYRO-2). The galley is cached once per label by the caller (no per-frame relayout).
- law
- ROOT LAW #0 — the rayon-free law, as machinery a test can actually fail
on (
law). ONE writer for korp and facett so the two repos hold the same line: our calls and our manifests are always red, a normal dependency edge to rayon is red, and the known dev-only third-party edge (image→ravif inside the screenshot-diff harness) is reported as context and never fails. ROOT LAW #0 — the rayon-free law, and the machinery that can actually report RED on it. Shared so korp and facett hold the same line from one writer (LAW 5) instead of two drifting copies of a grep. - legibility
- Legibility at scale — the shared screen-space toolbox (spatial hover index,
label collision avoidance, density-aware edge thinning) that makes a 100 000-node
graph or a 1 000 000-pin map readable. Pure, deterministic, headless-testable; the
legibility half of the story whose speed half is [
render::gpu::graphcloud]. Legibility at scale — the shared screen-space toolbox that makes a 100 000-node graph (or a 1 000 000-pin map) something a human can actually read. - look
- facett look & feel (the work-order architecture, §3) — one
Themestruct that fully describes a coherent, fast, fully-themeable look across every facett component, shipped as three presets: Windows, macOS, Device (effects-off, rugged/military). TheThemeis the single source of truth:Theme::applyinstalls a completeegui::Style(visuals + spacing + scroll) plus the text scale in one call, and also publishes the derived legacycrate::Themepalette so the existing custom-painted components follow with no per-component wiring (COH-1). - nav
- Shared spatial navigation + focus (§13 FOC-2, §14 NAV-1) — the one
pan/zoom model (
Navigable) reused by map/graph/plot/canvas, and the one spatial focus rule (nearest_in_direction) reused by pane and form navigation (COH-3). Pan/zoom is expressed as anegui::emath::TSTransform(scale + offset), so a host can also use it to transform an overlaid guest layer (§5 CMP-4). - overlay
- Composability & overlays (§5) + glass / masks (§20) — render any facett
component into an arbitrary sub-
Rect/layer of any other (a dataframe pinned over a map, a HUD over video), clipped by a mask, with optional glass gated byEffectsPolicy. - panel
- The constellation-wide
Paneltrait (Phase 0 foundation) — the primary UI-pane seam, with backend (1) native in-process (the blanketimpl<T: Facet> Panel for T) and backend (4) headless (panel::drive). See.nornir/wasm-ui-panels-design.md§1. ThePaneltrait — the constellation-wide UI-pane seam (Phase 0 foundation). - rabbit
- The znippy rabbit — facett’s synthetic/test mascot, as reusable
parametric geometry. znippy ships no logo asset, so the rabbit is generated
here: a friendly sitting-rabbit silhouette (rounded body + head + two upright
ears + an eye dot), built from deterministic arcs in a normalised
[-1, 1]²design box (x right, y up). No RNG, no per-frame randomness — two calls produce byte-identical geometry, so the wgpu/CPU snapshots stay stable. - render
- The L0 shared render kernel (CONS-CORE) — shared
Camera, z-orderedLayerStack, the CPU rect scissor, and (featurewgpu) the extracted GPU scaffold. Map skins +facett-graphviewdraw through this.facett-core::render— the L0 shared render kernel both map skins andfacett-graphviewdraw through (the CONS-CORE seam). - runtrace
- In-memory render/exec trace — the wasm-safe “what actually RAN” ledger.
- scroll_
engine - CygnusEd smooth-scroll engine (§11) — pixel-by-pixel, sub-pixel soft
scrolling with momentum/acceleration, à la the Amiga editor’s jerkyless feel.
The scroll offset is decoupled from row height (renderers paint at a
fractional pixel offset + clip), and the whole thing is deterministic
under an injected clock (
advance(dt)), so snapshots reproduce exactly (FC-7 / P0-5). Reusable by text, console, and the dataframe grid (SCRL-3). - severity
- facett-core::severity — the STRUCTURAL error signal for the Robot-UI HARD GATE (RESOLVED decision (a)).
- testmatrix
- The functional-status → nornir test-matrix bridge (feature
testmatrix). - theme
- Theming. A palette the custom-painted components (graph/depgraph/map)
read from the egui context, plus matching egui
Visualsfor the standard widgets (pop/table/pipeline). Callset_themeonce on the context and every facet follows. Ships aTheme::defaultlook, aTheme::sci_fineon-on-near-black look, and a switchable family of striking palettes (Theme::nordic_aurora,Theme::cyberpunk_neon,Theme::amber_crt,Theme::deep_space,Theme::hugin_noir). Enumerate them withTheme::ALL/Theme::by_nameto build a picker. - time_
axis - The shared pan/zoom-in-time axis (TIME-1) — the one time-window model
behind gantt/CFD/calendar/timeline, linkable across facets. Temporal sibling
of
nav::Navigable; the caps flagFacetCaps::time_scrollablepoints here. Shared pan/zoom-in-time axis (TIME-1) — the one time-window model behind every time-laid-out facet: gantt bars, a CFD’s day columns, a calendar’s weeks, a timeline’s events. It is the temporal sibling ofnav::Navigable: whereNavigablepans/zooms 2-D space,TimeAxispans/zooms a 1-D time window — and several facets can link to one axis (a shared time-scrubber scrolls them together) viasync_from. - trace
- Structured event trace — the machine-readable sibling of
harness::trail.
Macros§
- facet_
err - impl_
facet_ via_ elm - Write the
impl Facet for $tyfor a type that already implementsElm— the reusable version of the bridgefacett-securityhand-writes.
Structs§
- Edge
- A directed edge between node indices.
- Facet
Deck - A tabbed set of
Facets — the reusable multi-component shell. Draws a tab bar + the active facet, and composes every facet’sstate_jsonunder its title, so the whole-app introspection contract is free. korp/nornir can build their window from aFacetDeckinstead of hand-rolling tabs + the state dump. - Force
Cache - Converge-once-then-freeze layout cache. A force layout is a pure function of
the graph structure (node count + edge set) and the paint
rect, so this holds the last-computed positions and only re-runslayout_positionswhen the structure or rect actually changes. Embed it on a stateful host (e.g. aGraphView) and callForceCache::positionsfrom the render path — the O(n log n) (with Barnes–Hut) or O(n²) (small graphs) layout stops running every frame, which is the other half (besides Barnes–Hut) of killing the 30 000-node hang. - Node
- A node: a label + a colour (the consumer picks the colour policy — hash by label, by status, …).
- Scene
- A drawable graph: nodes + edges (edges index into
nodes).
Enums§
- Layout
- Node placement strategy.
Traits§
- Facet
- The facett component contract. Every facet — graph, map, pipeline, table, the ported nornir viewers — implements this, so consumers (korp, nornir, …) compose them uniformly and get headless robot-testing for free.
Functions§
- draw
- Draw a
Sceneintoui— the reusable render primitive. Empty scenes showempty_hint. Labels render when the node count is small enough to read. - draw_
positions - Paint a
Sceneintorectusing pre-computed node positions — the drawing half ofdraw, split out so a stateful host can freeze the layout: compute the O(n log n) force positions once (cached until the graph structure changes, seeForceCache) and paint them every frame WITHOUT re-running the layout.posmust be indexed likescene.nodes; short/empty falls back to the empty hint. - hash_
color - A stable, bright-ish colour from a string (FNV-1a). Handy default node colour.
- layout_
positions - Test/host hook (additive). The public, return-asserted view of the
private [
positions] layout node — the exact node centresdrawpaints forsceneunderlayoutinsiderect. Exposed so the graph-skin call-chain matrix can assert the layout stage (finite, in-rect, count == nodes, circular radius, force-fit normalisation) without a painter. Calls the same private fndrawuses, so it IS the layout the pixels come from — additive, no behaviour change.