Browse Source

forcegraph: when highlighting links, also highlight nodes

Nils Schneider 9 years ago
parent
commit
4e2e61f3c6
1 changed files with 2 additions and 1 deletions
  1. 2 1
      lib/forcegraph.js

+ 2 - 1
lib/forcegraph.js

@@ -167,6 +167,7 @@ define(["d3"], function (d3) {
 
           if (l) {
             highlightedLinks = [l]
+            highlightedNodes = [l.source, l.target]
 
             if (!nopanzoom) {
               var x = d3.extent([l.source, l.target], function (d) { return d.x })
@@ -280,7 +281,7 @@ define(["d3"], function (d3) {
 
       if (highlightedLinks.length) {
         ctx.save()
-        ctx.lineWidth = 16
+        ctx.lineWidth = 10
         ctx.strokeStyle = "#FFD486"
 
         highlightedLinks.forEach(function (d) {