title: Highlighting edges in D3 by hovering mouse over nodes
body: <p>I'm new to D3 and I'm using this template (<a href="http://bl.ocks.org/mbostock/1153292" rel="nofollow">http://bl.ocks.org/mbostock/1153292</a>) to visualize my graph. I'd like to highlight the links that are connected to a node by hovering mouse over the node. I tried the technique used in (<a href="http://jsfiddle.net/2pdxz/2/" rel="nofollow">http://jsfiddle.net/2pdxz/2/</a>) by adding the following lines to the script. </p>
  
  <pre><code>nodes.on('mouseover', function(d) {
    link.style('stroke-width', function(l) {
      if (d === l.source || d === l.target)
        return 4;
      else
        return 2;
      });
  });
  
  // Set the stroke width back to normal when mouse leaves the node.
  nodes.on('mouseout', function() {
    link.style('stroke-width', 2);
  });
  </code></pre>
  
  <p>But it seems not working for me and nothing happens when I move mouse over the nodes.</p>