Skip to content
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

Merged

Conversation

bronson-allen
Copy link
Contributor

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.

@@ -38,6 +38,8 @@ class DonutChart extends React.Component {
showBaseArc: PropTypes.bool,
showDataLabel: PropTypes.bool,
theme: themeShape,
toggleDataLabelOnHover: PropTypes.bool,
Copy link
Collaborator

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.

Copy link
Contributor Author

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

@cerinman
Copy link
Contributor

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,

Copy link
Contributor

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?

@cerinman
Copy link
Contributor

:shipit:

@cerinman cerinman merged commit 5287118 into mxenabled:master Jan 30, 2019
cerinman added a commit that referenced this pull request Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants