Skip to main content

Crate facett_graph

Crate facett_graph 

Source
Expand description

facett-graph — the graph (node/edge) viewer component, on facett_core. Build a Scene from a labelled edge list (the common shape: a graph query, a dataflow DAG) and draw it. Source-agnostic — the caller turns its Arrow/Cypher/whatever into edges first.

Modules§

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.

Structs§

DepEdge
A directed edge from → to, with the connecting items shown on the arrow.
DepGraphView
The layered dep-graph viewer. Implements Facet.
DepNode
One node: a label, an optional sub-label (a sha, a version…), and a border colour (the consumer’s status policy).
Edge
A directed edge between node indices.
FacetCaps
What a Facet can do, so hosts treat every component uniformly. All-false by default: a facet opts in to each capability it actually honors.
GraphView
A simple graph-view widget: a Scene + a Layout. Implements Facet, so it drops into a FacetDeck and exposes state_json for free.
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).
Theme
The facett palette. All custom-painted colours come from here.

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.
draw_arrow
Line + arrowhead from from to to (head pulled back by half a node width).
hash_color
A stable, bright-ish colour from a string (FNV-1a). Handy default node colour.
scene_from_labeled_edges
Build a Scene from a labelled edge list — each row is (src_id, dst_id, src_label, dst_label). Distinct ids become nodes, coloured per label (FNV-hashed). The reusable “graph from edges” adapter korp’s Graph and Pipelines views both want.
set_theme
Store theme on the context and apply its egui Visuals. Call once per frame (cheap) or whenever the theme changes; every facet picks it up.
theme
The theme stored on the ui’s context (or Theme::default if none).