Add LayoutLink, start with BFS for line drawing

This commit is contained in:
Ian Gulliver
2019-07-06 20:59:27 +00:00
parent 70b0e88f0d
commit d53e3260a8
3 changed files with 185 additions and 67 deletions

View File

@@ -7,6 +7,13 @@ class LayoutNode {
this.nodesByPos_.set(this.pos, this);
}
resolveLinks(nodesByGraphNode) {
this.links = [];
for (let to of this.graphNode_.links) {
this.links.push(nodesByGraphNode.get(to));
}
}
resolveAffinity(nodesByGraphNode) {
this.affinity_ = [];
for (let aff of this.graphNode_.affinity) {