Hooks Reference¶
Available React hooks for working with PyNodeWidget.
Hook Interactions¶
graph TB
subgraph Hooks
A[useSetNodeValues]
B[useSetNodesDict]
C[useAutoLayout]
D[useContextMenu]
E[useExport]
end
subgraph Contexts
F[SetNodeValuesContext]
G[SetNodesDictContext]
H[NodeDataContext]
end
subgraph Model
I[AnyWidget Model]
end
A --> F
B --> G
F --> I
G --> I
H --> I
C --> B
E --> I
style Hooks fill:#e3f2fd
style Contexts fill:#f3e5f5
style Model fill:#fff3e0
useSetNodeValues¶
Update field values for nodes.
Usage:
const setValue = useSetNodeValues();
// Update single field
setValue(prev => ({
...prev,
[nodeId]: { ...prev[nodeId], [fieldId]: newValue }
}));
useSetNodesDict¶
Update node structure.
Usage:
useAutoLayout¶
Auto-position nodes with Dagre.
Usage:
useContextMenu¶
Right-click menus.
Usage:
useExport¶
Export to JSON/image.
Usage:
Next Steps¶
- Architecture - Data flow
- Extension Guide - Custom components