react-plotly.js icon indicating copy to clipboard operation
react-plotly.js copied to clipboard

How to do simple animation on plots in react

Open szalaimd opened this issue 2 years ago • 1 comments

Hi,

I would like to do a simple animation on a scatterplot. The goal is to have the lines+markers of the plot move horizontally, similarly to the first example of https://plotly.com/javascript/animations/, but I can not find any example of how to achieve this when the Plot is a React component. In the example I can edit the relevant section of the code in codepen and by changing the original to the following I get the animation I am looking for (works only once, but shows what I would like to do). Plotly.animate('graph', { data: [{x: [0,1,2]}], ... My question is how could this be replicated in React (react-plotly.js) with a <Plot .../> component in the return function?

Thanks in advance!

szalaimd avatar Aug 17 '22 18:08 szalaimd

i have same question. I found an example in here

https://codesandbox.io/s/red-shape-bb5y8?file=/src/plotly/plotly.js

AlexBlack2202 avatar Sep 10 '22 12:09 AlexBlack2202