-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add bool and function to toggle data label changing on hover #819
Add bool and function to toggle data label changing on hover #819
Conversation
src/components/DonutChart.js
Outdated
@@ -38,6 +38,8 @@ class DonutChart extends React.Component { | |||
showBaseArc: PropTypes.bool, | |||
showDataLabel: PropTypes.bool, | |||
theme: themeShape, | |||
toggleDataLabelOnHover: PropTypes.bool, |
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 name makes it look like a function or similar to me. I prefer booleans to start with the prefix is, are, should or similar. In this case I think something like "shouldTriggerSliceHoverEvents" or "shouldToggleDataLabelOnHover" would be better options.
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.
I'll use shouldToggleDataLabelOnHover. Thanks, this was a difficult thing to try and name
The failing build here is due to an npm dependency in the docs having a vulnerability. If you pull master and merge it into your branch the build should succeed. |
showBaseArc: PropTypes.bool, | ||
showDataLabel: PropTypes.bool, | ||
theme: themeShape, | ||
|
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.
Doesn't look like we need this line break. Can you remove it?
Issue: #818
Change:
Add an additional boolean value that allows you to toggle this hover functionality on or off. For specific cases where there is no relevant data associated with a slice and you want to hover over a slice without animation AND without updating the data label in the center of the chart.
Update docs to describe new bool.