Inital commit
parent
cfd64ddd02
commit
ab86382a68
|
|
@ -88,6 +88,7 @@ The library enforces a strict separation of concerns via an asynchronous, decoup
|
|||
[DOM Element Nodes] [SVG Vector Overlay Patches]
|
||||
```
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 📚 API Reference
|
||||
|
|
|
|||
14
app.js
14
app.js
|
|
@ -1,11 +1,11 @@
|
|||
import { NodeEditor } from './NodeEditor.js';
|
||||
import { NodeEditor } from './NodeEditor.js'
|
||||
|
||||
// 1. Initialize the UI Engine
|
||||
const container = document.getElementById('editor-container');
|
||||
const editor = new NodeEditor(container);
|
||||
const container = document.getElementById('editor-container')
|
||||
const editor = new NodeEditor(container)
|
||||
|
||||
// 2. Extract the State Manager
|
||||
const graph = editor.getGraphManager();
|
||||
const graph = editor.getGraphManager()
|
||||
|
||||
// 3. Spawning Nodes
|
||||
const nodeA = graph.addNode({
|
||||
|
|
@ -15,7 +15,7 @@ const nodeA = graph.addNode({
|
|||
y: 150,
|
||||
inputs: [],
|
||||
outputs: [{ id: 'out_raw', name: 'Raw Buffer' }]
|
||||
});
|
||||
})
|
||||
|
||||
const nodeB = graph.addNode({
|
||||
type: 'processing_node',
|
||||
|
|
@ -24,7 +24,7 @@ const nodeB = graph.addNode({
|
|||
y: 250,
|
||||
inputs: [{ id: 'in_data', name: 'Payload' }],
|
||||
outputs: [{ id: 'out_success', name: 'Success' }]
|
||||
});
|
||||
})
|
||||
|
||||
// 4. Create a programmatically driven wire connection
|
||||
graph.connect(nodeA.id, 'out_raw', nodeB.id, 'in_data');
|
||||
graph.connect(nodeA.id, 'out_raw', nodeB.id, 'in_data')
|
||||
|
|
|
|||
Loading…
Reference in New Issue