Skip to main content

GraphView

Struct GraphView 

Source
pub struct GraphView { /* private fields */ }
Expand description

Read-only graph widget: computes (or receives) a Layout and renders cards + canvas-stroke edges with selection, pan and tooltips. See the module docs for the interaction vocabulary and the relayout rule.

Implementations§

Source§

impl GraphView

Source

pub fn new(desc: GraphDesc) -> GraphView

A view over desc, laid out by the default layered pass.

Source

pub fn algo(self, algo: GraphAlgo) -> GraphView

Select the layout pass (default: layered with default options).

Source

pub fn with_layout(self, layout: Layout) -> GraphView

Render a PRECOMPUTED layout instead of running a pass (the 0430 hand-positioned seam; desc still supplies metadata — labels, kinds, edge styles — via desc_index/id joins).

Source

pub fn style(self, style: GraphStyle) -> GraphView

Explicit resolved ink set (default: derived from the active theme at build).

Source

pub fn selected(self, sig: Signal<Option<String>>) -> GraphView

Controlled selection: bind the selected node id to an external signal (survives rebuilds; an internal signal is used otherwise and resets with the view).

Source

pub fn on_node_press(self, f: impl FnMut(&str) + 'static) -> GraphView

Node activation callback: fires on card click and on Enter over the selected node. Disposal-safe — the callback may dispose the view’s scope.

Source

pub fn badges(self, f: impl Fn(&str) -> Option<String> + 'static) -> GraphView

Reactive badge slot: evaluated per node id inside the card’s render scope, so signal reads make badges live.

Source

pub fn tooltips(self, delay: Duration) -> GraphView

Enable hover tooltips (node label/kind/id) with the given hover delay. Needs an overlay store: inside an App it resolves from context, otherwise pass GraphView::overlays; without either, tooltips are skipped (documented degradation).

Source

pub fn overlays(self, overlays: &Overlays) -> GraphView

Explicit overlay store for tooltips (tests, bare trees).

Source

pub fn offset_x(self, sig: Signal<i32>) -> GraphView

Bind the horizontal pan offset (overflow-honesty affordances: the app can derive “N cells off-screen” from offset + bounds).

Source

pub fn offset_y(self, sig: Signal<i32>) -> GraphView

Bind the vertical pan offset.

Source

pub fn layout(self, layout: LayoutStyle) -> GraphView

Outer layout style (default: a growing column).

Source

pub fn view(self, cx: Scope) -> View

Build the widget. Layout runs HERE (an act, cached in the view); see the module docs for the relayout rule.

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.