title: d3 Sankey - Highlight all connected paths from start to end
body: <p>I'm trying to highlight all the connected links and links of their target nodes till the end of the layout. </p>
  
  <p>The first level of highlighting can be easily achieved as follows - </p>
  
  <p>On node click, call <code>highlight_paths(1)</code>;</p>
  
  <pre><code>function highlight_paths(stroke_opacity) {
      return function(d,i){
          d.sourceLinks.forEach(function(srcLnk){
              d3.select("#link"+srcLnk.id).style("stroke-opacity", stroke_opacity);
          });
          d.targetLinks.forEach(function(srcLnk){
              d3.select("#link"+srcLnk.id).style("stroke-opacity", stroke_opacity);
          });
      }
  }
  </code></pre>
  
  <p>But I'm not yet able to write correctly a recursive algorithm to get all the sourceLinks and targetLinks of each of the connected source &amp; target nodes.</p>
  
  <p>All thoughts are appreciated!</p>
  
  <p>Thanks.</p>