Broken line width calculation (returns always 3)

new-map
Sebastian Lohff 4 years ago
parent ba59fd48d1
commit ec3ed26fa6

@ -151,9 +151,17 @@ d3.json("/api/v2/crawlrun/live/?with_graph").then((data) => {
const link = svg
.selectAll(".link")
.data(data.links)
.join((enter) =>
.join(enter =>
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

Loading…
Cancel
Save