Make LayoutGroup.moveBy() linear time

This commit is contained in:
Ian Gulliver
2019-07-05 06:10:41 +00:00
parent 9331f7b101
commit 396436aa01
3 changed files with 16 additions and 18 deletions

View File

@@ -53,11 +53,11 @@ class Layout {
this.groups_ = [];
for (let group of this.graph_.groups) {
let nodes = this.nodesFromGraphNodes(group.nodes);
this.groups_.push(new LayoutGroup(group, nodes));
this.groups_.push(new LayoutGroup(group, this.nodesByPos_, nodes));
}
for (let subgraph of this.graph_.nodesBySubgraph.values()) {
let nodes = this.nodesFromGraphNodes(subgraph);
this.groups_.push(new LayoutGroup(null, nodes));
this.groups_.push(new LayoutGroup(null, this.nodesByPos_, nodes));
}
}