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 the new animations #126

Merged
merged 17 commits into from
Aug 31, 2016
Merged

Add the new animations #126

merged 17 commits into from
Aug 31, 2016

Conversation

bulyonov
Copy link
Contributor

@bulyonov bulyonov commented Aug 23, 2016

This PR changes the way how the components are animated:

  • removes d3-transition;
  • does animation using react;
  • adds a possibility for minor tweaks of the animation

These changes are made for XYPlot, RadialChart and Treemap (and all their subcomponents)

This issue addresses #55, #91, #114 and #123

@@ -61,7 +70,7 @@ const defaultProps = {
orientation: BOTTOM
};

class Axis extends PureRenderComponent {
class Axis extends React.Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

How come this needs to be changed from PureRenderComponent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisirhc You are right. It is still in progress, testing this out.

const defaultStyle = {i: 0};
const style = {i: spring(1)};
return (
<Motion {...{defaultStyle, style, key: Math.random()}}>
Copy link
Contributor

Choose a reason for hiding this comment

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

What's key: Math.random() for? If it's a required hack, there should be a comment here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The spring is animated only at the time when motion renders. This means that it requires to be reinitialized somehow to make the next animation.

@bulyonov bulyonov changed the title WIP: Add the new animations Add the new animations Aug 26, 2016
@bulyonov bulyonov added this to the 0.6.x milestone Aug 26, 2016
- Remove the unused function.
* @private
*/
_mouseOverHandler(useValue, d) {
_mouseOverHandler(useValue, d, event) {
Copy link
Contributor

Choose a reason for hiding this comment

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

How is event passed to this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@chrisirhc Event is passed from inside of each of the series. I made the change to make it more transparent.

ayarcohaila added a commit to ayarcohaila/react-vis that referenced this pull request May 30, 2023
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