Simplify affinity, strengthen links

This commit is contained in:
Ian Gulliver
2019-07-16 05:28:02 +00:00
parent 5aeee2e8ea
commit 388813d094
3 changed files with 29 additions and 43 deletions

View File

@@ -57,15 +57,17 @@ class Layout {
this.groups_ = [];
for (let group of this.graph_.groups) {
let nodes = this.nodesFromGraphNodes(group.nodes);
this.groups_.push(new LayoutGroup(group, this.nodesByPos_, nodes));
this.groups_.push(new LayoutGroup(group, this.nodesByPos_, nodes, 'group'));
}
for (let subgraph of this.graph_.nodesBySubgraph.values()) {
let nodes = this.nodesFromGraphNodes(subgraph);
this.groups_.push(new LayoutGroup(null, this.nodesByPos_, nodes));
this.groups_.push(new LayoutGroup(null, this.nodesByPos_, nodes,
'subgraph'));
}
for (let labelGroup of this.graph_.nodesByLabel.values()) {
let nodes = this.nodesFromGraphNodes(labelGroup);
this.groups_.push(new LayoutGroup(null, this.nodesByPos_, nodes));
this.groups_.push(new LayoutGroup(null, this.nodesByPos_, nodes,
'labelgroup'));
}
}
@@ -223,7 +225,7 @@ class Layout {
addGroupPos() {
for (let group of this.groups_) {
if (!group.hasGraphGroup()) {
if (!group.isType('group')) {
continue;
}
let [min, max] = group.getMinMax();