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 0fb9899 commit f3a33bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ IE is no longer supported. dc.js will not support transpilation. Stick with dc@3

The API is mostly compatible, but there are a few breaking changes - see the [v4 upgrade guide](https://github.com/dc-js/dc.js/blob/develop/docs/dc-v4-upgrade-guide.md) for details.

## 3.2.1
* Fix rounding issue with equal ring sizes, by hofmeister ([#1662](https://github.com/dc-js/dc.js/pull/1662) / ([#1661](https://github.com/dc-js/dc.js/issues/1661))


## 3.2.0
* Support for general customizable ring sizes on the sunburst chart, by hofmeister ([#1625](https://github.com/dc-js/dc.js/pull/1655) / ([#1511](https://github.com/dc-js/dc.js/issues/1511))
* Sort sunburst wedges according to `baseMixin.ordering()`, by hofmeister ([#1625](https://github.com/dc-js/dc.js/pull/1655) / ([#1511](https://github.com/dc-js/dc.js/issues/1511))
Expand Down
2 changes: 1 addition & 1 deletion src/charts/sunburst-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ export class SunburstChart extends ColorMixin(BaseMixin) {
}

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

0 comments on commit f3a33bc

Please sign in to comment.