Skip to content

Commit 747eb23

Browse files
committed
Alex's suggestion for checking self-links too
1 parent 4e98b12 commit 747eb23

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/traces/sankey/defaults.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ function circularityPresent(nodeList, sources, targets) {
2020
var nodes = nodeList.map(function() {return [];});
2121

2222
for(var i = 0; i < Math.min(sources.length, targets.length); i++) {
23+
if(sources[i] === targets[i]) {
24+
return true; // self-link which is also a scc of one
25+
}
2326
nodes[sources[i]].push(targets[i]);
2427
}
2528

0 commit comments

Comments
 (0)