Avoid group label text with lines
This commit is contained in:
15
Layout.js
15
Layout.js
@@ -13,6 +13,7 @@ class Layout {
|
||||
this.resolveAffinity();
|
||||
this.resolveGroups();
|
||||
while (this.iterate());
|
||||
this.addGroupPos();
|
||||
this.drawLinks();
|
||||
this.fixOrigin();
|
||||
}
|
||||
@@ -194,6 +195,20 @@ class Layout {
|
||||
];
|
||||
}
|
||||
|
||||
addGroupPos() {
|
||||
for (let group of this.groups_) {
|
||||
if (!group.hasGraphGroup()) {
|
||||
continue;
|
||||
}
|
||||
let [min, max] = group.getMinMax();
|
||||
for (let x = min[0]; x <= max[0]; ++x) {
|
||||
for (let y = min[1]; y <= max[1]; ++y) {
|
||||
getOrSet(this.nodesByPos_, [x, y], group);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
drawLinks() {
|
||||
let links = [];
|
||||
for (let from of this.nodes_) {
|
||||
|
||||
@@ -81,4 +81,8 @@ class LayoutGroup {
|
||||
label: this.graphGroup_.label,
|
||||
};
|
||||
}
|
||||
|
||||
hasGraphGroup() {
|
||||
return this.graphGroup_ != null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user