Skip to main content

GraphView

Function GraphView 

Source
pub fn GraphView(_: GraphViewProps) -> Element
Expand description

Renders the property model bipartite graph using D3.

Installs a container-scoped bidirectional evaluation channel before D3 initialization on desktop and web (including book hosts). Each generation owns one cached Adam model. Source/container replacement and unmount close JavaScript subscriptions/polling and abort the Rust receiver. Errors are reported through the platform diagnostics channel and a visible alert; no JavaScript view policy substitutes for a failed model.

With external_container, the host supplies an existing container outside this Dioxus root (as mdBook does). This component renders only its lifecycle anchor and fallback diagnostic, never a second element with the same id. The shared channel also displays failures inside that external container.

The zoom controls and the “Show inactive” toggle live in App’s top bar (not here) — they only ever call window.beginGraph.*/set a signal App owns, so they don’t need to be inside this component to work.

§Examples

use adam_web_ui::{GraphData, GraphView};
use dioxus::prelude::*;

fn graph(id: ReadSignal<String>, data: ReadSignal<GraphData>,
         source: ReadSignal<String>) -> Element {
    rsx! { GraphView { graph_id: id, data, source_id: source } }
}

§Props

For details, see the props struct definition.