mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-02-13 00:24:48 +08:00
22 lines
635 B
JavaScript
22 lines
635 B
JavaScript
/**
|
|
* 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 ""
|
|
}
|
|
} |