JSFiddle - React, Tailwind, and code Playground
by schinckel
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.4.2/knockout-min.js"></script>
<svg id="tree"></svg>
JavaScript
function Node(parent, label) {
this.value = ko.observable(label);
this.parent = ko.observable(parent);
}
Node.prototype.addChildren = function(labels) {
labels.map((label) => new Node(this, label));
}
Node.prototype.children = function() {
}