Skip to main content

SystemChart

Struct SystemChart 

Source
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

Source

pub fn new( title: impl Into<String>, nodes: Vec<SysNode>, edges: Vec<SysEdge>, ) -> Self

Source

pub fn with_canvas_height(self, h: f32) -> Self

Source

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.

Source

pub fn clear_selection(&mut self)

Clear the selection.

Source

pub fn selected(&self) -> Option<&str>

The selected node’s id, if any.

Source

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.

Source

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

Source§

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>

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.

Source§

fn title(&self) -> &str

Source§

fn ui(&mut self, ui: &mut Ui)

Source§

fn state_json(&self) -> Value

Source§

fn selection_json(&self) -> Value

The current selection as JSON (also folded into state_json by convention). Null when nothing/none selectable.
Source§

fn scale(&self) -> f32

Current uniform scale (1.0 = native). Override if caps().scalable.
Source§

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>

Clipboard hooks — see clipboard.rs. Defaults: nothing to give/take. Returns the text to place on the clipboard (None = nothing copyable now).
Source§

fn cut(&mut self) -> Option<String>

Like copy, but also removes the selection. Default delegates to copy.
Source§

fn paste(&mut self, _text: &str) -> bool

Accept pasted text. Returns true if consumed.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

Source§

fn simd_from(value: T, _simd: S) -> T

Source§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

Source§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.