Try to stack like nodes

This commit is contained in:
Ian Gulliver
2019-07-08 03:00:31 +00:00
parent 83ce35c2dd
commit 311c32b2c5
2 changed files with 9 additions and 0 deletions

View File

@@ -58,6 +58,11 @@ class GraphNode {
if (this.groups.size && !intersects(this.groups, node.groups)) {
node.addAffinity(this, d => d <= 2 ? -INF : 0);
}
// Try to stack nodes with the same label
if (node.label == this.label) {
this.addAffinity(node, (d, v) => v[0] == 0 ? 200 : 500);
}
}
for (let to of this.links) {