-
Notifications
You must be signed in to change notification settings - Fork 29
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
[Documentation Request]: Animation #27
Comments
Since the owner of the repo seems silent on addressing issues, i'll address two main issues here for others to reference. AnimationAs is, the component doesn't support animation. Why? Two reasons.
How can you get around this? (for those that need a one-and-done, not a reusable solution)
const transitionSpec = {
transition: {
duration: 500,
easing: 'cubic-in-out',
},
frame: {
duration: 500,
redraw: false
}
}
animatePlot() {
try {
return Plotly.animate(
this.$refs.container,
{
data: this.data,
layout: this.internalLayout,
config: {
...this.getOptions(),
animationAttributes: transitionSpec, // <--- hardcoded above
displaylogo: false
}
},
)
}
catch (error) {
// maybe fall back here to this.react()
console.log('error', error)
}
},
reactAnimate() {
let dr = this.internalLayout.datarevision
if (dr === 1) {
this.react()
}
else {
this.animatePlot()
}
}, This will work because If you want to make it more reusable, add a prop to the component for the animation configuration. ResizeIf you specify <Plotly :autoResize="true"/> This must be set on the components creation, as the function NOTE if you made my above changes for animation, you do not need to change the debounced function. Leave this as |
So how do you call the animation in the component? Is the plot automatically animated after adding those extra lines of codes above? |
Heads up, the solution posted above does not work. |
can someone help with this issue? would be super nice if the animation feature works! |
Please provide a minimal example of animation with your wrapper. I have data dynamically bound, but it seems to just have plotly redraw, when animation is specified in
options
The text was updated successfully, but these errors were encountered: