Highlight links

This commit is contained in:
Ian Gulliver
2019-07-10 23:41:41 +00:00
parent 0aa272c224
commit dda2102f99
7 changed files with 47 additions and 6 deletions

View File

@@ -1,8 +1,9 @@
class LayoutLink {
constructor(from, to, label, nodesByPos, linksByPos, labelsByPos) {
constructor(from, to, label, highlight, nodesByPos, linksByPos, labelsByPos) {
this.from_ = from;
this.to_ = to;
this.label_ = label;
this.highlight_ = highlight;
this.nodesByPos_ = nodesByPos;
this.linksByPos_ = linksByPos;
this.labelsByPos_ = labelsByPos;
@@ -223,6 +224,7 @@ class LayoutLink {
type: 'line',
pos: Array.from(this.path[0]),
cls: 's' + this.getOutPoint(this.path[0], this.path[1]),
highlight: this.highlight_,
});
for (let i = 1; i < this.path.length - 1; ++i) {
@@ -232,6 +234,7 @@ class LayoutLink {
type: 'line',
pos: Array.from(this.path[i]),
cls: `i${inPoint}o${outPoint}`,
highlight: this.highlight_,
});
}
@@ -242,12 +245,14 @@ class LayoutLink {
type: 'line',
pos: Array.from(this.path[this.path.length - 1]),
cls: 's' + endInPoint,
highlight: this.highlight_,
});
steps.push({
type: 'arrow',
pos: Array.from(this.path[this.path.length - 1]),
cls: 'a' + endInPoint,
highlight: this.highlight_,
});
if (this.labelPos_) {