Skip to content

Commit ab41bbe

Browse files
committed
fix(sankey): declare loop counter locally; add draftlog
The inner loop reused the file-scope `i` before its var declaration line, tripping biome's noInvalidUseBeforeDeclaration, and the PR was missing its changelog draftlog entry.
1 parent a3c70f8 commit ab41bbe

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

draftlogs/7977_fix.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Fix `node.pad` reduction warning so it derives the effective (post-clamp) padding from the laid-out node geometry instead of reading `sankey.nodePadding()`, which since @plotly/d3-sankey 0.12.x returns the configured value and made the warning never fire [[#7977](https://github.com/plotly/plotly.js/pull/7977)]

src/traces/sankey/render.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ function sankeyModel(layout, d, traceIndex) {
8989
});
9090
for(var key in columns) {
9191
var column = columns[key].sort(function(a, b) { return a[0] - b[0]; });
92-
for(i = 1; i < column.length; i++) {
93-
var gap = column[i][0] - column[i - 1][1];
92+
for(var n = 1; n < column.length; n++) {
93+
var gap = column[n][0] - column[n - 1][1];
9494
if(gap < effectivePad) effectivePad = gap;
9595
}
9696
}

0 commit comments

Comments
 (0)