Rip out all the graphviz stuff
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -24,10 +24,6 @@ class EditorLabel extends EditorEntryBase {
|
||||
};
|
||||
}
|
||||
|
||||
exportGraphviz() {
|
||||
return [];
|
||||
}
|
||||
|
||||
getLabel() {
|
||||
return this.input_.value;
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -23,13 +23,6 @@ class EditorNode extends EditorEntryBase {
|
||||
};
|
||||
}
|
||||
|
||||
exportGraphviz() {
|
||||
if (this.getLabel() == '') {
|
||||
return [];
|
||||
}
|
||||
return ['"' + this.id + '" [label="' + this.getLabel() + '"];'];
|
||||
}
|
||||
|
||||
getLabel() {
|
||||
return this.input_.value;
|
||||
}
|
||||
|
||||
9
utils.js
9
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) {
|
||||
|
||||
Reference in New Issue
Block a user