d3 Sankey - Highlight all connected paths from start to end
问题 I'm trying to highlight all the connected links and links of their target nodes till the end of the layout. The first level of highlighting can be easily achieved as follows - On node click, call highlight_paths(1) ; 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