Broken line width calculation (returns always 3)

This commit is contained in:
Sebastian Lohff 2020-06-13 23:52:50 +02:00
parent ba59fd48d1
commit ec3ed26fa6
1 changed files with 10 additions and 2 deletions

View File

@ -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