Plumb link labels through to layout

This commit is contained in:
Ian Gulliver
2019-07-10 17:17:17 +00:00
parent 75bc85919c
commit 245bbb86f4
5 changed files with 35 additions and 17 deletions

View File

@@ -212,10 +212,11 @@ class Layout {
drawLinks() {
let links = [];
for (let from of this.nodes_) {
for (let to of from.links) {
for (let link of from.links) {
links.push({
from: from,
to: to,
to: link.to,
label: link.label,
});
}
}
@@ -227,9 +228,13 @@ class Layout {
for (let link of links) {
this.links_.push(
new LayoutLink(link.from, link.to,
new LayoutLink(link.from, link.to, link.label,
this.nodesByPos_, this.linksByPos_));
}
for (let link of this.links_) {
link.drawLabel();
}
}
distance(a, b) {