react-plotly.js
react-plotly.js copied to clipboard
How to do simple animation on plots in react
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!
i have same question. I found an example in here
https://codesandbox.io/s/red-shape-bb5y8?file=/src/plotly/plotly.js