Skip to content

Commit edd00fb

Browse files
committed
fix(sankey): tolerate padding comparison rounding
1 parent b0687ab commit edd00fb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/traces/sankey/render.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ function sankeyModel(layout, d, traceIndex) {
112112
}
113113
}
114114

115-
if(effectivePad < nodePad) {
115+
// Allow for floating-point rounding when the effective gap is exactly
116+
// nodePad (for example, 29.999999999999943 for a requested pad of 30).
117+
if(effectivePad < nodePad - 1e-6) {
116118
Lib.warn('node.pad was reduced to ', effectivePad, ' to fit within the figure.');
117119
}
118120

@@ -1132,4 +1134,4 @@ module.exports = function(gd, svg, calcData, layout, callbacks) {
11321134
nodeLabel
11331135
.transition()
11341136
.ease(c.ease).duration(c.duration);
1135-
};
1137+
};

0 commit comments

Comments
 (0)