pub struct DecoratedGraphView { /* private fields */ }Expand description
An interactive, decorated pan/zoom graph pane Facet.
Implementations§
Source§impl DecoratedGraphView
impl DecoratedGraphView
Sourcepub fn with_model(self, model: GraphModel) -> Self
pub fn with_model(self, model: GraphModel) -> Self
Set the graph model (nodes already laid out in world space + edges).
Sourcepub fn with_decorations(self, decorations: Decorations) -> Self
pub fn with_decorations(self, decorations: Decorations) -> Self
Set the decorations overlay (rings/badges + emphasis edges).
Sourcepub fn set_title(&mut self, title: impl Into<String>)
pub fn set_title(&mut self, title: impl Into<String>)
Re-title (the deck keys facets off [Facet::title]).
Sourcepub fn state(&self) -> &GraphViewState
pub fn state(&self) -> &GraphViewState
FC-3 — read the complete observable state at any frame boundary.
Sourcepub fn fit(&mut self)
pub fn fit(&mut self)
Reset pan + zoom (the ⊙ fit affordance). A thin wrapper over the FC-2
update mutation path.
Sourcepub fn select(&mut self, id: Option<String>)
pub fn select(&mut self, id: Option<String>)
Select a node by id (lights its downstream subtree), or None to clear. A thin
wrapper over the FC-2 update mutation path.
Sourcepub fn lit_set(&self) -> BTreeSet<String>
pub fn lit_set(&self) -> BTreeSet<String>
The downstream-lit set for the current selection (empty when none).
Sourcepub fn local() -> Self
pub fn local() -> Self
Discovery-contract local() — a realistic 4-node DAG (a → b, a → c,
b → d, c → d) decorated with a green coverage ring on a, an amber badge
on b, and an emphasis “cut” edge d → a (dashed, labelled), so the pane
paints real chips, rings, a badge, and an overlay edge with no host.
Source§impl DecoratedGraphView
impl DecoratedGraphView
Sourcepub fn view(&self, ui: &mut Ui) -> Vec<Msg>
pub fn view(&self, ui: &mut Ui) -> Vec<Msg>
FC-9 render — a pure function of &self: it paints the header, the
edges + decorated chips, and returns the Msgs the interactions produced
(fit / pan / zoom / node-select). It MUST NOT mutate the GraphViewState;
the impl_facet_via_elm! bridge applies the
returned messages through update. One-frame latency on the
camera + selection is the standard immediate-mode Elm trade (a repaint follows).
Trait Implementations§
Source§impl CopySource for DecoratedGraphView
impl CopySource for DecoratedGraphView
Source§fn copy_kinds(&self) -> &[ClipKind]
fn copy_kinds(&self) -> &[ClipKind]
Source§fn copy_payload(&self) -> Option<ClipPayload>
fn copy_payload(&self) -> Option<ClipPayload>
Source§impl Elm for DecoratedGraphView
impl Elm for DecoratedGraphView
Source§type Model = GraphViewState
type Model = GraphViewState
Source§type Msg = Msg
type Msg = Msg
Model.Source§type Effect = Effect
type Effect = Effect
enum Effect {} when the component does no I/O.Source§fn title(&self) -> &str
fn title(&self) -> &str
Facet::title).Source§fn state(&self) -> &GraphViewState
fn state(&self) -> &GraphViewState
Source§impl Facet for DecoratedGraphView
impl Facet for DecoratedGraphView
Source§fn ui(&mut self, ui: &mut Ui)
fn ui(&mut self, ui: &mut Ui)
FC-9: the view is pure (paints + emits Msgs); FC-2: mutation only
via update. The immediate-mode trait just bridges the two.
Source§fn caps(&self) -> FacetCaps
fn caps(&self) -> FacetCaps
Themed (chips/rings follow the palette) + resizable + selectable (a node drill-in) + navigable (pan/drag + scroll-zoom + fit).
fn title(&self) -> &str
fn state_json(&self) -> Value
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
state_json by
convention). Null when nothing/none selectable.Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
FacetDeck (e.g. a robot-UI driver clicking an
app-level control that must forward to a concrete component’s own API).
Defaulted to None so no existing facet has to change; a component opts in
by returning Some(self).Source§fn set_scale(&mut self, _scale: f32)
fn set_scale(&mut self, _scale: f32)
Source§fn cut(&mut self) -> Option<String>
fn cut(&mut self) -> Option<String>
copy, but also removes the selection. Default delegates to copy.Source§fn kind(&self) -> &'static str
fn kind(&self) -> &'static str
"jobview", "graphpan", "table"). Two
instances with the same kind can exchange portable state; the empty
default "" means opted out of cross-instance clone.Source§fn portable_state(&self) -> Option<Value>
fn portable_state(&self) -> Option<Value>
None = not cloneable. Kept SEPARATE from
state_json (the introspection dump, which may carry
derived / render-only data) so this stays round-trippable through
load_state.Source§fn load_state(&mut self, _state: &Value) -> bool
fn load_state(&mut self, _state: &Value) -> bool
portable_state
on a same-kind sibling. Returns true if accepted. Default false
(opt-in per component).