@theclearsky/react-blender-nodes 0.0.7 → 0.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -4
- package/dist/index.d.ts +1281 -18
- package/dist/react-blender-nodes.css +1 -1
- package/dist/react-blender-nodes.es.js +22426 -13474
- package/dist/react-blender-nodes.es.js.map +1 -1
- package/dist/react-blender-nodes.umd.js +214 -97
- package/dist/react-blender-nodes.umd.js.map +1 -1
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="./docs/logo.svg" alt="react-blender-nodes logo" width="80" />
|
|
3
|
+
</p>
|
|
4
|
+
<h1 align="center">react-blender-nodes</h1>
|
|
5
|
+
<p align="center">
|
|
6
|
+
A React component library inspired by Blender's node editor interface, providing<br/>
|
|
7
|
+
a flexible and customizable node-based graph editor for web applications.
|
|
8
|
+
</p>
|
|
5
9
|
|
|
6
10
|

|
|
7
11
|
|
|
@@ -186,6 +190,63 @@ https://github.com/user-attachments/assets/72d9384a-e9ca-4223-906a-dc422fb66f49
|
|
|
186
190
|
- **State Management**: Integrated reducer for managing graph state
|
|
187
191
|
- **TypeScript Support**: Full type safety with comprehensive definitions
|
|
188
192
|
|
|
193
|
+
### 🚀 Node Runner — Execute Your Graphs
|
|
194
|
+
|
|
195
|
+

|
|
196
|
+
|
|
197
|
+
Turn your node graphs into executable programs. The built-in runner compiles
|
|
198
|
+
your graph into an execution plan and runs it — with full debugging support.
|
|
199
|
+
|
|
200
|
+
- **Two execution modes**:
|
|
201
|
+
- **Instant**: Runs the entire graph at once, then replay via the timeline
|
|
202
|
+
- **Step-by-step**: Pause after each node, manually advance with step/resume
|
|
203
|
+
- **Execution timeline**: Multi-track timeline visualization showing each node's
|
|
204
|
+
execution as a block, grouped by concurrency level
|
|
205
|
+
- Scrubber with drag-to-seek and snap-to-step
|
|
206
|
+
- Zoom, pan, and auto-fit controls
|
|
207
|
+
- Wall-clock and execution-time display modes (strips out pause/debug
|
|
208
|
+
overhead)
|
|
209
|
+
- Auto-scroll follows the current step during live execution
|
|
210
|
+
- **Step inspector**: Click any timeline block to inspect a step's input values,
|
|
211
|
+
output values, timing, errors, and loop/group context
|
|
212
|
+
- **Visual node states**: Nodes on the canvas highlight in real time as idle,
|
|
213
|
+
running, completed, skipped, or errored
|
|
214
|
+
|
|
215
|
+

|
|
216
|
+
|
|
217
|
+
- **Loop support**: Define iterative computation with loop-start/stop/end node
|
|
218
|
+
triplets — the runner compiles loop bodies into `LoopExecutionBlock`s with
|
|
219
|
+
per-iteration recording and configurable max-iteration limits
|
|
220
|
+
- **Node groups**: Compose subgraphs into reusable group nodes — the compiler
|
|
221
|
+
recursively resolves group subtrees into `GroupExecutionScope`s
|
|
222
|
+
- **Execution recording**: Every run produces a full `ExecutionRecord` with
|
|
223
|
+
per-step timing, input/output snapshots, and loop iteration details — export
|
|
224
|
+
and import recordings as JSON for sharing and offline analysis
|
|
225
|
+
|
|
226
|
+

|
|
227
|
+
|
|
228
|
+
### Usage
|
|
229
|
+
|
|
230
|
+
```tsx
|
|
231
|
+
import { FullGraph, useFullGraph } from 'react-blender-nodes';
|
|
232
|
+
import { makeFunctionImplementationsWithAutoInfer } from 'react-blender-nodes';
|
|
233
|
+
|
|
234
|
+
// Define what each node type does when executed
|
|
235
|
+
const functionImplementations = makeFunctionImplementationsWithAutoInfer({
|
|
236
|
+
myNodeType: async ({ inputs }) => {
|
|
237
|
+
// Process inputs and return outputs
|
|
238
|
+
return { outputHandle: inputs.inputHandle * 2 };
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
|
|
242
|
+
// Pass implementations to FullGraph to enable the runner
|
|
243
|
+
<FullGraph
|
|
244
|
+
state={state}
|
|
245
|
+
dispatch={dispatch}
|
|
246
|
+
functionImplementations={functionImplementations}
|
|
247
|
+
/>;
|
|
248
|
+
```
|
|
249
|
+
|
|
189
250
|
## Usage Examples
|
|
190
251
|
|
|
191
252
|
### Smart Type System with Validation
|
|
@@ -364,6 +425,25 @@ Visit `http://localhost:6006` to see:
|
|
|
364
425
|
- Usage examples
|
|
365
426
|
- Handle shape demonstrations
|
|
366
427
|
|
|
428
|
+
### Architecture & Internal Documentation
|
|
429
|
+
|
|
430
|
+
For contributors and developers building on the library internals, a full
|
|
431
|
+
documentation index is available at [`docs/index.md`](./docs/index.md). It
|
|
432
|
+
includes an ASCII architecture diagram, cross-feature dependency maps, and a
|
|
433
|
+
**"What to Read Based on What You're Building"** guide:
|
|
434
|
+
|
|
435
|
+
| Task | Key Docs |
|
|
436
|
+
| ---------------------------- | --------------------------------------------------------------------------- |
|
|
437
|
+
| Adding a new data type | `dataTypesDoc`, `handlesDoc`, `typeInferenceDoc`, `connectionValidationDoc` |
|
|
438
|
+
| Adding a new node type | `nodesDoc`, `handlesDoc`, `configurableNodeDoc`, `stateManagementDoc` |
|
|
439
|
+
| Making nodes executable | `runnerCompilerDoc`, `runnerExecutorDoc`, `runnerHookDoc` |
|
|
440
|
+
| Building node groups / loops | `nodeGroupsDoc`, `loopsDoc`, `connectionValidationDoc` |
|
|
441
|
+
| Modifying graph editor UI | `fullGraphDoc`, `configurableNodeDoc`, `contextMenuDoc` |
|
|
442
|
+
| Working with state/reducer | `stateManagementDoc`, `immerDoc`, `edgesDoc` |
|
|
443
|
+
|
|
444
|
+
See the [full index](./docs/index.md) for all 32 feature docs with relative
|
|
445
|
+
links organized by tier.
|
|
446
|
+
|
|
367
447
|
### Component API
|
|
368
448
|
|
|
369
449
|
#### FullGraph
|