-
Notifications
You must be signed in to change notification settings - Fork 26
added radius prop to VictoryPie per issue #910 #182
Conversation
Please add an |
Added support for origin prop to Victory-Pie. If origin prop is not present, origin is calculated from width, height, and padding as before. Closes FormidableLabs/victory#910 |
The values for origin.x and origin.y should be restricted to non-negative numbers. Functions don’t make sense here. |
src/components/victory-pie.js
Outdated
@@ -102,6 +102,16 @@ class VictoryPie extends React.Component { | |||
labelRadius: PropTypes.oneOfType([ CustomPropTypes.nonNegative, PropTypes.func ]), | |||
labels: PropTypes.oneOfType([ PropTypes.func, PropTypes.array ]), | |||
name: PropTypes.string, | |||
origin: PropTypes.arrayOf(PropTypes.shape({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be an array of objects. Just a single one.
src/components/victory-pie.js
Outdated
CustomPropTypes.allOfType([CustomPropTypes.integer, CustomPropTypes.nonNegative]) | ||
]), | ||
y: PropTypes.oneOfType([ | ||
PropTypes.func, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These can just be CustomPropTypes.nonNegative
…igin definition and removed offsetWidth and offsetHeight in helper-methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved! Thank you for this change
Added support for radius prop to Victory-Pie. If radius prop is not present, radius is calculated from width, height, and padding as before.
-Added radius prop to propTypes in victory-pie.js
-Added check to getRadius in helper-methods.js
Closes FormidableLabs/victory#910