pub struct SystemChart {
pub title: String,
pub nodes: Vec<SysNode>,
pub edges: Vec<SysEdge>,
/* private fields */
}Expand description
The system-map chart: nodes + edges + the current selection.
Fields§
§title: String§nodes: Vec<SysNode>§edges: Vec<SysEdge>Implementations§
Source§impl SystemChart
impl SystemChart
pub fn new( title: impl Into<String>, nodes: Vec<SysNode>, edges: Vec<SysEdge>, ) -> Self
pub fn with_canvas_height(self, h: f32) -> Self
Sourcepub fn select(&mut self, id: &str)
pub fn select(&mut self, id: &str)
Select a node by id (headless-test + host entry point). Selecting the already-selected node deselects it. Unknown id is a no-op.
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the selection.
Sourcepub fn set_badge(&mut self, id: &str, badge: u64)
pub fn set_badge(&mut self, id: &str, badge: u64)
Update a node’s badge by id (e.g. a live event count). No-op if unknown.
Sourcepub fn set_detail(&mut self, id: &str, detail: impl Into<String>)
pub fn set_detail(&mut self, id: &str, detail: impl Into<String>)
Update a node’s detail text by id. No-op if unknown.
Trait Implementations§
Source§impl Facet for SystemChart
impl Facet for SystemChart
Source§fn caps(&self) -> FacetCaps
fn caps(&self) -> FacetCaps
Painted with the active Theme (nodes/edges/text/accent ring), and its
canvas takes the host’s available width — themeable + resizable.
Source§fn as_any_mut(&mut self) -> Option<&mut dyn Any>
fn as_any_mut(&mut self) -> Option<&mut dyn Any>
Opt into typed downcast so a host (e.g. the demo’s robot-UI node-select
toolbar) can forward a selection to SystemChart::select when this chart
lives boxed inside a FacetDeck.
fn title(&self) -> &str
fn ui(&mut self, ui: &mut Ui)
fn state_json(&self) -> Value
Source§fn selection_json(&self) -> Value
fn selection_json(&self) -> Value
The current selection as JSON (also folded into
state_json by
convention). Null when nothing/none selectable.Source§fn set_scale(&mut self, _scale: f32)
fn set_scale(&mut self, _scale: f32)
Set the uniform scale; clamp internally. Default no-op (not scalable).
Source§fn copy(&mut self) -> Option<String>
fn copy(&mut self) -> Option<String>
Clipboard hooks — see clipboard.rs. Defaults: nothing to give/take.
Returns the text to place on the clipboard (None = nothing copyable now).
Auto Trait Implementations§
impl Freeze for SystemChart
impl RefUnwindSafe for SystemChart
impl Send for SystemChart
impl Sync for SystemChart
impl Unpin for SystemChart
impl UnsafeUnpin for SystemChart
impl UnwindSafe for SystemChart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more