Animating a ScatterGL Graph in Plotly

Viewed 113

I am trying to animate several frames of a ScatterGL graph in Plotly. I can show a single plot with ScatterGL, but when I try to animate the plot, I get the following error:

Uncaught TypeError: r[d] is undefined
    exports http://127.0.0.1:61355/:65
    d http://127.0.0.1:61355/:65
    plot http://127.0.0.1:61355/:65
    drawData http://127.0.0.1:61355/:65
    syncOrAsync http://127.0.0.1:61355/:65
    plot http://127.0.0.1:61355/:65
    call http://127.0.0.1:61355/:65
    layoutReplot http://127.0.0.1:61355/:65
    syncOrAsync http://127.0.0.1:61355/:65
    q http://127.0.0.1:61355/:65
    call http://127.0.0.1:61355/:65
    _redrawTimer http://127.0.0.1:61355/:65

This is my baseline reproducible example:

import numpy as np
import plotly.graph_objects as go

N = 10
fig = go.Figure(
    data=[
        go.Scattergl(
            x=np.random.randn(N),
            y=np.random.randn(N),
            mode="markers",
            marker=dict(size=4, colorbar=dict(thickness=30, ypad=80),),
        )
    ],
    layout=go.Layout(
        title="Start Title",
        updatemenus=[
            dict(
                type="buttons",
                buttons=[dict(label="Play", method="animate", args=[None])],
            )
        ],
    ),
    frames=[
        go.Frame(
            data=[
                go.Scattergl(
                    x=np.random.randn(N),
                    y=np.random.randn(N),
                    mode="markers",
                    marker=dict(size=4, colorbar=dict(thickness=30, ypad=80),),
                )
            ]
        ),
    ],
)

fig.show()

Am I doing something wrong here? Or is ScatterGL not capable of animation?

0 Answers
Related