[TASK] Show different vpn-links

This commit is contained in:
Martin Geno 2017-10-31 14:22:00 +01:00
parent 4caf38e990
commit 31e8667658
No known key found for this signature in database
GPG Key ID: F0D39A37E925E941
3 changed files with 4 additions and 4 deletions

View File

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

View File

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

View File

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