From 31e8667658fbe59277d2ed5081d7dfc55bc4e847 Mon Sep 17 00:00:00 2001 From: Martin Geno Date: Tue, 31 Oct 2017 14:22:00 +0100 Subject: [PATCH] [TASK] Show different vpn-links --- lib/forcegraph.js | 4 ++-- lib/forcegraph/draw.js | 2 +- lib/map/labellayer.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/forcegraph.js b/lib/forcegraph.js index 7346c5e..d3f0b88 100644 --- a/lib/forcegraph.js +++ b/lib/forcegraph.js @@ -122,13 +122,13 @@ define(['d3-selection', 'd3-force', 'd3-zoom', 'd3-drag', 'd3-timer', 'd3-ease', forceLink = d3Force.forceLink() .distance(function (d) { - if (d.o.type === 'vpn') { + if (d.o.type.indexOf('vpn') === 0) { return 0; } return 75; }) .strength(function (d) { - if (d.o.type === 'vpn') { + if (d.o.type.indexOf('vpn') === 0) { return 0.02; } return Math.max(0.5, d.o.source_tq); diff --git a/lib/forcegraph/draw.js b/lib/forcegraph/draw.js index 6976297..f5c2ed2 100644 --- a/lib/forcegraph/draw.js +++ b/lib/forcegraph/draw.js @@ -87,7 +87,7 @@ define(['helper'], function (helper) { ctx.lineTo(to[0], to[1]); ctx.strokeStyle = grd; - if (d.o.type === 'vpn') { + if (d.o.type.indexOf('vpn') === 0) { ctx.globalAlpha = 0.2; ctx.lineWidth = 1.5; } else { diff --git a/lib/map/labellayer.js b/lib/map/labellayer.js index fbfef01..7a49146 100644 --- a/lib/map/labellayer.js +++ b/lib/map/labellayer.js @@ -97,7 +97,7 @@ define(['leaflet', 'rbush', 'helper', 'moment'], function addLinksToMap(dict, linkScale, graph, router) { graph = graph.filter(function (d) { - return 'distance' in d && !d.vpn; + return 'distance' in d && d.type.indexOf('vpn') !== 0; }); return graph.map(function (d) {