diff --git a/sankey/sankey.js b/sankey/sankey.js index c3bc59f..abe137b 100644 --- a/sankey/sankey.js +++ b/sankey/sankey.js @@ -118,7 +118,9 @@ d3.sankey = function() { node.x = x; node.dx = nodeWidth; node.sourceLinks.forEach(function(link) { - nextNodes.push(link.target); + if (nextNodes.indexOf(link.target) < 0) { + nextNodes.push(link.target); + } }); }); remainingNodes = nextNodes;