From 04ec47e393e6da56d3270e651d04f25344fbd89c Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Wed, 10 Jul 2019 20:34:44 +0000 Subject: [PATCH] Rip out all the graphviz stuff --- EditorEntryBase.js | 2 -- EditorGroup.js | 19 ------------------- EditorLabel.js | 4 ---- EditorLink.js | 20 -------------------- EditorNode.js | 7 ------- utils.js | 9 --------- 6 files changed, 61 deletions(-) diff --git a/EditorEntryBase.js b/EditorEntryBase.js index 0d93a4c..f184765 100644 --- a/EditorEntryBase.js +++ b/EditorEntryBase.js @@ -4,8 +4,6 @@ class EditorEntryBase extends ListenUtils { constructor() { super(); - this.id = randStr64(); - this.elem_ = document.createElement('li'); this.elem_.tabIndex = 0; this.listen(this.elem_, 'focus', () => this.onElemFocus()); diff --git a/EditorGroup.js b/EditorGroup.js index b0d9342..0325572 100644 --- a/EditorGroup.js +++ b/EditorGroup.js @@ -27,25 +27,6 @@ class EditorGroup extends EditorEntryBase { }; } - exportGraphviz() { - let lines = [ - 'subgraph "cluster_' + this.id + '" {', - ]; - - if (this.getLabel() != '') { - lines.push('\tlabel = "' + this.getLabel() + '";'); - } - - for (let obj of this.nodes) { - for (let line of obj.exportGraphviz()) { - lines.push('\t' + line); - } - } - - lines.push('}'); - return lines; - } - getNodes() { return this.nodes_.getEntries(EditorNode); } diff --git a/EditorLabel.js b/EditorLabel.js index 7727971..acc67e9 100644 --- a/EditorLabel.js +++ b/EditorLabel.js @@ -24,10 +24,6 @@ class EditorLabel extends EditorEntryBase { }; } - exportGraphviz() { - return []; - } - getLabel() { return this.input_.value; } diff --git a/EditorLink.js b/EditorLink.js index 019b8bd..458b0ee 100644 --- a/EditorLink.js +++ b/EditorLink.js @@ -29,26 +29,6 @@ class EditorLink extends EditorEntryBase { }; } - exportGraphviz() { - if (this.getFrom().getLabel() == '' || this.getTo().getLabel() == '') { - return []; - } - - let label = ''; - if (this.getLabel() != '') { - label = ' [label="' + this.getLabel() + '"]'; - } - - let ret = []; - for (let from of this.from) { - for (let to of this.to) { - ret.push('"' + from.id + '" -> "' + to.id + '"' + label + ';'); - } - } - - return ret; - }; - getFrom() { return this.nodes_.getEntries(EditorNode)[0]; } diff --git a/EditorNode.js b/EditorNode.js index 54eed88..a63a95d 100644 --- a/EditorNode.js +++ b/EditorNode.js @@ -23,13 +23,6 @@ class EditorNode extends EditorEntryBase { }; } - exportGraphviz() { - if (this.getLabel() == '') { - return []; - } - return ['"' + this.id + '" [label="' + this.getLabel() + '"];']; - } - getLabel() { return this.input_.value; } diff --git a/utils.js b/utils.js index 19aed7a..bce00eb 100644 --- a/utils.js +++ b/utils.js @@ -1,12 +1,3 @@ -function randStr32() { - let num = Math.floor(Math.random() * Math.pow(2, 32)); - return num.toString(16).padStart(8, '0'); -} - -function randStr64() { - return randStr32() + randStr32(); -} - function getOrSet(container, key, newValue) { let val = container.get(key); if (!val) {