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.
- Curve
Editor - XY graph editor for a numeric over-lifetime curve.
- Curve
Response - Outcome of one widget interaction.
- Gradient
Bar - Color stop strip editor for a color over-lifetime gradient.
- Graph
Response - The widget’s return value.
- Graph
View - All persistable view state for one graph canvas.
- Grid
Config - Grid configuration for the canvas background and snapping.
- Link
- A directed link from an output port to an input port.
- Node
Desc - Per-frame description of a node, supplied by the viewer.
- Node
Graph - The node-graph widget.
- NodeId
- Identifier of a node, one-based.
- Port
Addr - A fully-qualified port address: a node plus one of its ports.
- Port
Desc - Description of a single port, supplied per-frame by the viewer.
- PortId
- Identifies a port within a single node.
- Stack
Desc - Per-frame description of a stack: an ordered container of member nodes.
- StackId
- Identifier of a stack (ordered node container), one-based.
- Stack
Link - A fixed vertical connection between two stacks.
- Transform
- Maps between world coordinates (
f64) and screen coordinates (f32). - World
Rect - An axis-aligned rectangle in world space, stored as min corner + size.
Enums§
- Canvas
Item - A movable canvas unit: a free node or a whole stack.
- External
Drop Target - A graph location suitable for an external drop.
- Graph
Action - A structural change the consumer may choose to apply.
- Port
Side - Which side of a node a port sits on.
Traits§
- Graph
Viewer - Implemented by the consumer to expose its graph to the widget.
Type Aliases§
- Link
Verdict - Outcome of asking the consumer whether a link is valid.
- World
Pos - A point in the infinite
f64world plane.