From ec3ed26fa6d7192b3cec5e3e5a1c0827a1321559 Mon Sep 17 00:00:00 2001 From: Sebastian Lohff Date: Sat, 13 Jun 2020 23:52:50 +0200 Subject: [PATCH] Broken line width calculation (returns always 3) --- bgpdata/templates/bgpdata/new_new_map.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bgpdata/templates/bgpdata/new_new_map.html b/bgpdata/templates/bgpdata/new_new_map.html index 3a5b2f2..8fa38b0 100644 --- a/bgpdata/templates/bgpdata/new_new_map.html +++ b/bgpdata/templates/bgpdata/new_new_map.html @@ -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