From 8b10d2ec10f6700e639624c6674fc59d419ce39d Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Sun, 2 Aug 2015 00:34:53 +0200 Subject: [PATCH] forcegraph: tweaks --- lib/forcegraph.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lib/forcegraph.js b/lib/forcegraph.js index 9b85e86..7b00b0e 100644 --- a/lib/forcegraph.js +++ b/lib/forcegraph.js @@ -381,7 +381,6 @@ define(["d3"], function (d3) { }) ctx.fillStyle = clientColor - ctx.globalCompositeOperation = "overlay" ctx.fill() ctx.restore() @@ -395,13 +394,12 @@ define(["d3"], function (d3) { ctx.globalCompositeOperation = "lighten" ctx.fillStyle = highlightColor + ctx.beginPath() highlightedNodes.forEach(function (d) { - ctx.beginPath() ctx.moveTo(d.x + 5 * nodeRadius, d.y) ctx.arc(d.x, d.y, 5 * nodeRadius, 0, 2 * Math.PI) - ctx.fill() - ctx.restore() }) + ctx.fill() ctx.restore() } @@ -418,12 +416,12 @@ define(["d3"], function (d3) { ctx.strokeStyle = highlightColor ctx.lineCap = "round" + ctx.beginPath() highlightedLinks.forEach(function (d) { - ctx.beginPath() ctx.moveTo(d.source.x, d.source.y) ctx.lineTo(d.target.x, d.target.y) - ctx.stroke() }) + ctx.stroke() ctx.restore() }