pub struct DepGraphView {
pub title: String,
pub nodes: Vec<DepNode>,
pub edges: Vec<DepEdge>,
/* private fields */
}Expand description
The layered dep-graph viewer. Implements [Facet].
Fields§
§title: String§nodes: Vec<DepNode>§edges: Vec<DepEdge>Implementations§
Source§impl DepGraphView
impl DepGraphView
pub fn new(nodes: Vec<DepNode>, edges: Vec<DepEdge>) -> Self
Sourcepub fn state(&self) -> &DepGraphState
pub fn state(&self) -> &DepGraphState
FC-3 — read the complete observable interaction state.
pub fn with_title(self, t: impl Into<String>) -> Self
Sourcepub fn select(&mut self, node: Option<String>)
pub fn select(&mut self, node: Option<String>)
Drill into a node by its stable label (or None to clear). A thin wrapper
over the FC-2 update mutation path (the sole way the Model
changes): deterministic (a set, never a toggle).
Sourcepub fn columns(&self) -> Vec<usize>
pub fn columns(&self) -> Vec<usize>
Column index per node — toposort, deps first (left). Longest-path layering so a dependent sits right of all its deps. Cycle → best effort.
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 boxes/arrows +
the drill-down panel and returns the Msgs the node clicks produced. It
MUST NOT mutate the DepGraphState; the
impl_facet_via_elm! bridge applies the
returned messages through update.
Trait Implementations§
Source§impl CopySource for DepGraphView
impl CopySource for DepGraphView
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 DepGraphView
impl Elm for DepGraphView
Source§type Model = DepGraphState
type Model = DepGraphState
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) -> &DepGraphState
fn state(&self) -> &DepGraphState
Source§impl Facet for DepGraphView
impl Facet for DepGraphView
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
Boxes/arrows/labels are painted from the active [Theme]; a node can be
click-selected (drives the drill-down panel); the layered canvas takes the
host’s available_size.
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 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 as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
fn as_any_mut(&mut self) -> Option<&mut (dyn Any + 'static)>
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 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).