From e0630808e3aad2bf8711137817a4577f4e6a61b9 Mon Sep 17 00:00:00 2001 From: Xaver Maierhofer Date: Sun, 29 Oct 2017 11:36:29 +0100 Subject: [PATCH] [TASK] Put clients drawing together --- lib/forcegraph/draw.js | 4 ---- lib/map/clientlayer.js | 3 --- lib/utils/helper.js | 4 ++++ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/forcegraph/draw.js b/lib/forcegraph/draw.js index 2fddc4e..fa18a83 100644 --- a/lib/forcegraph/draw.js +++ b/lib/forcegraph/draw.js @@ -10,7 +10,6 @@ define(['helper'], function (helper) { var highlight; var nodeColor = '#fff'; - var clientColor = '#e6324b'; var highlightColor = 'rgba(255, 255, 255, 0.2)'; var labelColor = '#fff'; @@ -20,10 +19,7 @@ define(['helper'], function (helper) { function drawDetailNode(d) { if (transform.k > 1) { - ctx.beginPath(); - ctx.fillStyle = clientColor; helper.positionClients(ctx, d, Math.PI, d.o, 15); - ctx.fill(); ctx.beginPath(); var name = d.o.node_id; if (d.o) { diff --git a/lib/map/clientlayer.js b/lib/map/clientlayer.js index 9bc5281..c970bfa 100644 --- a/lib/map/clientlayer.js +++ b/lib/map/clientlayer.js @@ -53,10 +53,7 @@ define(['leaflet', 'rbush', 'helper'], p.x -= s.x; p.y -= s.y; - ctx.beginPath(); - ctx.fillStyle = 'rgba(220, 0, 103, 0.7)'; helper.positionClients(ctx, p, d.startAngle, d.node, startDistance); - ctx.fill(); }); diff --git a/lib/utils/helper.js b/lib/utils/helper.js index dfcc9f5..ee6a211 100644 --- a/lib/utils/helper.js +++ b/lib/utils/helper.js @@ -162,6 +162,9 @@ define({ var a = 1.2; var mode = 0; + ctx.beginPath(); + ctx.fillStyle = 'rgba(220, 0, 103, 0.7)'; + for (var orbit = 0, i = 0; i < node.clients; orbit++) { var distance = startDistance + orbit * 2 * radius * a; var n = Math.floor((Math.PI * distance) / (a * radius)); @@ -187,5 +190,6 @@ define({ ctx.arc(x, y, radius, 0, 2 * Math.PI); } } + ctx.fill(); } });