Skip to content

Commit

Permalink
feat(pie): add ability to use default dataset order (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
Raphaël Benitte authored Oct 21, 2017
1 parent 4b4865f commit f4a261d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/components/charts/pie/Pie.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const Pie = ({
outerWidth,
outerHeight,

sortByValue,
innerRadius: _innerRadius,
padAngle: _padAngle,
cornerRadius,
Expand Down Expand Up @@ -107,6 +108,7 @@ const Pie = ({

const pie = d3Pie()
pie.value(d => d.value)
if (sortByValue !== true) pie.sortValues(null)

const arc = d3Arc()
arc.outerRadius(radius)
Expand Down
2 changes: 2 additions & 0 deletions src/components/charts/pie/props.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const PiePropTypes = {
})
).isRequired,

sortByValue: PropTypes.bool.isRequired,
innerRadius: PropTypes.number.isRequired,
padAngle: PropTypes.number.isRequired,
cornerRadius: PropTypes.number.isRequired,
Expand Down Expand Up @@ -61,6 +62,7 @@ export const PiePropTypes = {
}

export const PieDefaultProps = {
sortByValue: false,
innerRadius: 0,
padAngle: 0,
cornerRadius: 0,
Expand Down

0 comments on commit f4a261d

Please sign in to comment.