Tag object

Fixes #1
This commit is contained in:
Ian Gulliver
2019-07-14 20:44:07 +00:00
parent d47cec70c1
commit 07e26a2a6c
11 changed files with 248 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ class Layout {
this.setInitialPositions();
this.resolveGroups();
this.resolveLinks();
this.resolveTags();
this.setAffinity();
while (this.iterate());
this.addGroupPos();
@@ -74,6 +75,15 @@ class Layout {
}
}
resolveTags() {
this.tags_ = [];
for (let i = 0; i < this.graph_.tags.length; ++i) {
let tag = this.graph_.tags[i];
let nodes = this.nodesFromGraphNodes(tag.nodes);
this.tags_.push(new LayoutTag(tag, nodes, i));
}
}
setAffinity() {
for (let node of this.nodes_) {
node.setAffinity(this.nodesByGraphNode_);
@@ -298,3 +308,4 @@ class Layout {
<!--# include file="LayoutGroup.js" -->
<!--# include file="LayoutLink.js" -->
<!--# include file="LayoutNode.js" -->
<!--# include file="LayoutTag.js" -->