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

Feature: add an animationWhitelist array to the animate prop #1209

Merged
merged 1 commit into from
Dec 20, 2018

Conversation

cullenjett
Copy link
Contributor

Addresses #1186

This PR allows users to override the default animationWhitelist for components that accept an animate prop.

When a component has an animate prop it will render itself within a <VictoryTransition /> wrapper, which then renders a <VictoryAnimation /> component with a subset of data to "tween". Initially, that subset was determined by pulling data keys that were included in a module-scoped array of strings (["data", "style", "domain", ...]). These changes allow an animate.animationWhitelist prop to override that array and also moves the default array to a static property on the component so users can reference it if necessary.

There's still room for improvement by allowing users to specify sub-properties they want to animate. For example, instead of enabling/disabling all animations for style it would be great to enable/disable animation for style.fill or style.opacity, etc. That gets a little more difficult when dealing with the data animations though.

Copy link
Contributor

@boygirl boygirl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect! Thank you for also moving the existing whitelists to statics on each class.

@boygirl boygirl merged commit 3d4802d into master Dec 20, 2018
@boygirl boygirl deleted the feature/animation-whitelist branch December 20, 2018 19:26
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.

2 participants