Handle global label
This commit is contained in:
12
Graph.js
12
Graph.js
@@ -6,6 +6,7 @@ class Graph {
|
||||
this.groups = [];
|
||||
this.links = [];
|
||||
this.nodes = [];
|
||||
this.label = null;
|
||||
|
||||
this.processList(def.editor);
|
||||
this.removeSoftNodes();
|
||||
@@ -30,6 +31,10 @@ class Graph {
|
||||
this.processGroup(item);
|
||||
break;
|
||||
|
||||
case 'label':
|
||||
this.processLabel(item);
|
||||
break;
|
||||
|
||||
case 'link':
|
||||
this.processLink(item);
|
||||
break;
|
||||
@@ -49,6 +54,13 @@ class Graph {
|
||||
this.processList(item.members, true);
|
||||
}
|
||||
|
||||
processLabel(item) {
|
||||
if (item.label == '') {
|
||||
return;
|
||||
}
|
||||
this.label = item.label;
|
||||
}
|
||||
|
||||
processLink(item) {
|
||||
let link = GraphLink.process(item);
|
||||
if (!link) {
|
||||
|
||||
Reference in New Issue
Block a user