Skip to main content

Crate hanabi_node_graph

Crate hanabi_node_graph 

Source
Expand description

NodeGraph: a reusable egui node-graph canvas.

The widget depends only on egui and serde. The consumer supplies graph topology by implementing GraphViewer, owns persistable view state in a GraphView, and applies any structural change the widget reports via GraphResponse.

The canvas is an “infinite”, pan/zoomable f64 world plane with an optional snapping grid. Nodes have input/output ports linked by spline edges.

Structs§

ChipHit
A drawn input value chip and its screen rect.
CurveEditor
XY graph editor for a numeric over-lifetime curve.
CurveResponse
Outcome of one widget interaction.
GradientBar
Color stop strip editor for a color over-lifetime gradient.
GraphResponse
The widget’s return value.
GraphView
All persistable view state for one graph canvas.
GridConfig
Grid configuration for the canvas background and snapping.
Link
A directed link from an output port to an input port.
NodeDesc
Per-frame description of a node, supplied by the viewer.
NodeGraph
The node-graph widget.
NodeId
Identifier of a node, one-based.
PortAddr
A fully-qualified port address: a node plus one of its ports.
PortDesc
Description of a single port, supplied per-frame by the viewer.
PortId
Identifies a port within a single node.
StackDesc
Per-frame description of a stack: an ordered container of member nodes.
StackId
Identifier of a stack (ordered node container), one-based.
StackLink
A fixed vertical connection between two stacks.
Transform
Maps between world coordinates (f64) and screen coordinates (f32).
WorldRect
An axis-aligned rectangle in world space, stored as min corner + size.

Enums§

CanvasItem
A movable canvas unit: a free node or a whole stack.
ExternalDropTarget
A graph location suitable for an external drop.
GraphAction
A structural change the consumer may choose to apply.
PortSide
Which side of a node a port sits on.

Traits§

GraphViewer
Implemented by the consumer to expose its graph to the widget.

Type Aliases§

LinkVerdict
Outcome of asking the consumer whether a link is valid.
WorldPos
A point in the infinite f64 world plane.