import Template from "./Template" export default class NodeTemplate extends Template { /** * Computes the html content of the target element. * @param {HTMLElement} element Target element * @returns The computed html */ header(element) { return `
${element.graphNodeName}
` } /** * Computes the html content of the target element. * @param {HTMLElement} element Target element * @returns The computed html */ body(element) { return `
${element.inputs.forEach((input, index) => `
${input.name}
`) ?? ''}
${element.outputs.forEach((output, index) => `
${output.name}
`) ?? ''}
` } /** * Computes the html content of the target element. * @param {HTMLElement} element Target element * @returns The computed html */ render(element) { return `
${this.header(element)} ${this.body(element)}
` } }