Broken line width calculation (returns always 3)
This commit is contained in:
parent
ba59fd48d1
commit
ec3ed26fa6
|
@ -151,9 +151,17 @@ d3.json("/api/v2/crawlrun/live/?with_graph").then((data) => {
|
||||||
const link = svg
|
const link = svg
|
||||||
.selectAll(".link")
|
.selectAll(".link")
|
||||||
.data(data.links)
|
.data(data.links)
|
||||||
.join((enter) =>
|
.join(enter =>
|
||||||
enter.append("line")
|
enter.append("line")
|
||||||
.attr("class", "link"));
|
.attr("class", "link"))
|
||||||
|
.style("stroke-width", l => {
|
||||||
|
let width = l.source.neighbors + l.target.neighbors + 2;
|
||||||
|
if(isNaN(width))
|
||||||
|
return 3
|
||||||
|
else
|
||||||
|
return width
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
// Nodes data join
|
// Nodes data join
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue