Skip to content

Commit 26541c3

Browse files
authored
Merge pull request #4442 from plotly/almost-equal-branchvalues-total
Add ALMOST_EQUAL tolerance in branchvalue:total partial sum check
2 parents 4137ed2 + 08aa81b commit 26541c3

File tree

3 files changed

+425
-1
lines changed

3 files changed

+425
-1
lines changed

src/traces/sunburst/calc.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ var makePullColorFn = require('../pie/calc').makePullColorFn;
1717
var generateExtendedColors = require('../pie/calc').generateExtendedColors;
1818
var colorscaleCalc = require('../../components/colorscale').calc;
1919

20+
var ALMOST_EQUAL = require('../../constants/numerical').ALMOST_EQUAL;
21+
2022
var sunburstExtendedColorWays = {};
2123
var treemapExtendedColorWays = {};
2224

@@ -165,7 +167,7 @@ exports.calc = function(gd, trace) {
165167
v = partialSum;
166168
}
167169

168-
if(v < partialSum) {
170+
if(v < partialSum * ALMOST_EQUAL) {
169171
failed = true;
170172
return Lib.warn([
171173
'Total value for node', d.data.data.id,
Loading

0 commit comments

Comments
 (0)