Skip to content

How to do simple animation on plots in react #283

@szalaimd

Description

@szalaimd

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions