pub struct Node<T = ()> {Show 14 fields
pub id: Id,
pub position: Point,
pub label: String,
pub data: T,
pub node_type: Option<String>,
pub source_side: Side,
pub target_side: Side,
pub draggable: bool,
pub selectable: bool,
pub selected: bool,
pub size: Option<Size>,
pub measured: Option<Size>,
pub class: Option<String>,
pub style: Option<String>,
}Expand description
A node in the flow graph.
T is a user-defined payload available to custom node renderers.
Fields§
§id: Id§position: PointPosition of the node’s top-left corner, in flow coordinates.
label: StringLabel rendered by the default node view.
data: TCustom payload for custom node views.
node_type: Option<String>Node type tag. The default view recognizes "input" (source handle
only) and "output" (target handle only); custom views can match on
any value.
source_side: SideSide where outgoing edges leave (used by the default view’s source handle and as the anchor fallback).
target_side: SideSide where incoming edges arrive.
draggable: bool§selectable: bool§selected: bool§size: Option<Size>Explicit size. When None (default) the node sizes to its content and
is measured automatically.
measured: Option<Size>Measured size, maintained by the framework.
class: Option<String>Extra CSS classes for the node wrapper (e.g. Tailwind utilities).
style: Option<String>Extra inline CSS for the node wrapper.
Implementations§
Source§impl<T> Node<T>
impl<T> Node<T>
Sourcepub fn with_data(
id: impl Into<Id>,
label: impl Into<String>,
position: impl Into<Point>,
data: T,
) -> Self
pub fn with_data( id: impl Into<Id>, label: impl Into<String>, position: impl Into<Point>, data: T, ) -> Self
Create a node carrying a custom payload.