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

@@ -34,7 +34,7 @@ class GraphNode {
for (let from of this.linksIn) {
from.setSubgraph(subgraph, nodes);
}
for (let group of this.groups.values()) {
for (let group of this.groups) {
for (let node of group.nodes) {
node.setSubgraph(subgraph, nodes);
}
@@ -64,7 +64,7 @@ class GraphNode {
this.addAffinity(to, d => d <= 2 ? -INF : d * 11);
to.addAffinity(this, d => d <= 2 ? -INF : d * 9);
}
for (let group of this.groups.values()) {
for (let group of this.groups) {
for (let node of group.nodes) {
this.addAffinity(node, d => d * 100);
}