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]
|
[DOM Element Nodes] [SVG Vector Overlay Patches]
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## 📚 API Reference
|
## 📚 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
|
// 1. Initialize the UI Engine
|
||||||
const container = document.getElementById('editor-container');
|
const container = document.getElementById('editor-container')
|
||||||
const editor = new NodeEditor(container);
|
const editor = new NodeEditor(container)
|
||||||
|
|
||||||
// 2. Extract the State Manager
|
// 2. Extract the State Manager
|
||||||
const graph = editor.getGraphManager();
|
const graph = editor.getGraphManager()
|
||||||
|
|
||||||
// 3. Spawning Nodes
|
// 3. Spawning Nodes
|
||||||
const nodeA = graph.addNode({
|
const nodeA = graph.addNode({
|
||||||
|
|
@ -15,7 +15,7 @@ const nodeA = graph.addNode({
|
||||||
y: 150,
|
y: 150,
|
||||||
inputs: [],
|
inputs: [],
|
||||||
outputs: [{ id: 'out_raw', name: 'Raw Buffer' }]
|
outputs: [{ id: 'out_raw', name: 'Raw Buffer' }]
|
||||||
});
|
})
|
||||||
|
|
||||||
const nodeB = graph.addNode({
|
const nodeB = graph.addNode({
|
||||||
type: 'processing_node',
|
type: 'processing_node',
|
||||||
|
|
@ -24,7 +24,7 @@ const nodeB = graph.addNode({
|
||||||
y: 250,
|
y: 250,
|
||||||
inputs: [{ id: 'in_data', name: 'Payload' }],
|
inputs: [{ id: 'in_data', name: 'Payload' }],
|
||||||
outputs: [{ id: 'out_success', name: 'Success' }]
|
outputs: [{ id: 'out_success', name: 'Success' }]
|
||||||
});
|
})
|
||||||
|
|
||||||
// 4. Create a programmatically driven wire connection
|
// 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