Skip to content

Commit ef3eef8

Browse files
committed
test(sankey): use star topology so clamping is actually exercised
A 24-node chain places one node per column, so no column ever holds two nodes and the padding can never clamp regardless of figure size. A one-to-many star puts all 24 sinks in one column (verified against the real d3-sankey layout: effective min gap 2.32 at 480x80).
1 parent 0504083 commit ef3eef8

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

test/jasmine/tests/sankey_test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ describe('sankey tests', function() {
110110
thickness: 10
111111
},
112112
link: {
113-
source: Array.from({length: 23}, function(_, i) { return i; }),
114-
target: Array.from({length: 23}, function(_, i) { return i + 1; }),
115-
value: Array.from({length: 23}, function() { return 1; })
113+
// star topology: one source feeding 24 sinks puts all 24
114+
// sink nodes in a single column, so a small figure must
115+
// clamp the padding
116+
source: Array.from({length: 24}, function() { return 0; }),
117+
target: Array.from({length: 24}, function(_, i) { return i + 1; }),
118+
value: Array.from({length: 24}, function() { return 1; })
116119
}
117120
}],
118121
layout: {

0 commit comments

Comments
 (0)