Skip to content

Commit

Permalink
compare ring sum within epsilon of 1
Browse files Browse the repository at this point in the history
fixes #1661
closes #1662
  • Loading branch information
gordonwoodhull committed Mar 5, 2020
1 parent 83577c1 commit 31882af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sunburst-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ dc.sunburstChart = function (parent, chartGroup) {
}

var portionsSum = d3.sum(relativeSizes);
if (portionsSum !== 1) {
if (Math.abs(portionsSum - 1) > dc.constants.NEGLIGIBLE_NUMBER) {
throw new dc.errors.BadArgumentException(
'relativeRingSizes : portions must add up to 1, but sum was ' + portionsSum);
}
Expand Down

0 comments on commit 31882af

Please sign in to comment.