Inital commit

master
Jeremy Hayes 2026-06-05 11:16:01 -05:00
parent cfd64ddd02
commit ab86382a68
2 changed files with 20 additions and 19 deletions

View File

@ -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

38
app.js
View File

@ -1,30 +1,30 @@
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({
type: 'source_node', type: 'source_node',
title: 'Data Stream', title: 'Data Stream',
x: 100, x: 100,
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',
title: 'Transform Matrix', title: 'Transform Matrix',
x: 450, x: 450,
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')