Serialization work in progress

This commit is contained in:
barsdeveloper
2021-10-17 21:54:40 +02:00
parent 16fd34fa84
commit 9caea42101
29 changed files with 635 additions and 242 deletions

25
js/graph/GraphNode.js Normal file
View File

@@ -0,0 +1,25 @@
import SelectableDraggable from "./SelectableDraggable"
import NodeTemplate from "../template/NodeTemplate"
export default class GraphNode extends SelectableDraggable {
constructor() {
super(new NodeTemplate())
this.graphNodeName = 'n/a'
this.inputs = []
this.outputs = []
}
connectedCallback() {
const type = this.getAttribute('type')?.trim()
super.connectedCallback()
this.classList.add('ueb-node')
if (this.selected) {
this.classList.add('ueb-selected')
}
this.style.setProperty('--ueb-position-x', this.location[0])
this.style.setProperty('--ueb-position-y', this.location[1])
}
}
customElements.define('u-node', GraphNode)