Nodes can be added using raw HTML or by registering a template for reuse.
Add a Node with HTML
Use the df-* attribute pattern (e.g., df-name) in your HTML to synchronize input/textarea/select elements with the node's data object.
var html = `<div><input type="text" df-name></div>`;
var data = { "name": '' };
editor.addNode('github', 0, 1, 150, 300, 'github', data, html);
Register a Node for Reuse
var html = document.createElement("div");
html.innerHTML = "Hello Drawflow!!";
editor.registerNode('test', html);
// Use the registered node
editor.addNode('github', 0, 1, 150, 300, 'github', data, 'test', true);
Register a Vue Component Node
import component from '~/components/testcomponent.vue'
editor.registerNode('name', component, props, options);
// Use the Vue node
editor.addNode('github', 0, 1, 150, 300, 'github', data, 'name', 'vue');