Skip to main content

Crate facett_core

Crate facett_core 

Source
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 caps::FacetCaps;
pub use clipboard::ClipAction;
pub use deckfx::DeckFx;
pub use deckfx::DeckRaven;
pub use theme::Theme;
pub use theme::set_theme;
pub use theme::theme;

Modules§

caps
Uniform capability model — every Facet returns a small FacetCaps descriptor so a host (the FacetDeck, korp, nornir) can treat all components uniformly: query “is this scalable?”, “copyable?”, “searchable?” without knowing the concrete type. See .nornir/design/capability-model.md.
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 focused TextEdit consumes first — so a form field handles its own copy and the facet-level copy only 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/cut return the text). See .nornir/design/clipboard.md.
deckfx
Deck-level effects + theming — wires the theme palettes and the effects bloom/raven into the FacetDeck as opt-in, host-controllable features.
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.
harness
Headless test harness — fire up a Facet, inject data, render it offscreen, and capture what it drew: its state_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’s NORNIR_VIZ_STATE introspection — every component is observable from outside.
theme
Theming. A palette the custom-painted components (graph/depgraph/map) read from the egui context, plus matching egui Visuals for the standard widgets (pop/table/pipeline). Call set_theme once on the context and every facet follows. Ships a Theme::default look, a Theme::sci_fi neon-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 with Theme::ALL / Theme::by_name to build a picker.
trace
Structured event trace — the machine-readable sibling of harness::trail.

Structs§

Edge
A directed edge between node indices.
FacetDeck
A tabbed set of Facets — the reusable multi-component shell. Draws a tab bar + the active facet, and composes every facet’s state_json under its title, so the whole-app introspection contract is free. korp/nornir can build their window from a FacetDeck instead of hand-rolling tabs + the state dump.
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 Scene into ui — the reusable render primitive. Empty scenes show empty_hint. Labels render when the node count is small enough to read.
hash_color
A stable, bright-ish colour from a string (FNV-1a). Handy default node colour.