Plumb link labels through to layout
This commit is contained in:
11
Layout.js
11
Layout.js
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user