Browse Source

Broken line width calculation (returns always 3)

new-map
Sebastian Lohff 2 years ago
parent
commit
ec3ed26fa6
  1. 12
      bgpdata/templates/bgpdata/new_new_map.html

12
bgpdata/templates/bgpdata/new_new_map.html

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