This commit is contained in:
barsdeveloper
2021-10-09 22:11:11 +02:00
parent 4406b4abe7
commit 84606486c4
15 changed files with 40 additions and 40 deletions

22
js/GraphEntity.js Normal file
View File

@@ -0,0 +1,22 @@
/**
* A Graph Entity is an element that can stay directly (as a first child) on the blueprint grid. Those entities are either nodes or links
*/
export default class GraphEntity extends HTMLElement {
constructor() {
super()
/** @type {import("./UEBlueprint").EBlueprint}" */
this.blueprint = null
}
connectedCallback() {
this.blueprint = this.closest('u-blueprint')
let aDiv = document.createElement('div')
aDiv.innerHTML = this.render()
this.appendChild(aDiv.firstElementChild)
}
// Subclasses want to rewrite this
render() {
return ""
}
}