plotly.py icon indicating copy to clipboard operation
plotly.py copied to clipboard

Animated Scattergl Graph Object TypeError

Open swansk opened this issue 4 years ago • 2 comments

This bug occurs while generating offline and online graphs in Plotly (version = "4.14.3").

When animating a Scattergl graph object, the scatter plot goes blank and a type error is reported in the console. The error follows as:

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

Reproducible example follows below:

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()

This issue only occurs with Scattergl, if you replace Scattergl with Scatter in the above example, the animation will play as intended.

swansk avatar Jun 11 '21 19:06 swansk

Might be a similar issue to https://github.com/plotly/plotly.js/issues/2791

The redraw appears to be causing the TypeError

swansk avatar Jun 14 '21 16:06 swansk

how do you to slove this problem?

xuxiaoxxxx avatar Apr 02 '24 02:04 xuxiaoxxxx

Hi - we are tidying up stale issues and PRs in Plotly's public repositories so that we can focus on things that are still important to our community. Since this one has been sitting for a while, I'm going to close it; if it is still a concern, please add a comment letting us know what recent version of our software you've checked it with so that I can reopen it and add it to our backlog. If you'd like to submit a PR, we'd be happy to prioritize a review, and if it's a request for tech support, please post in our community forum. Thank you - @gvwilson

gvwilson avatar Jul 11 '24 13:07 gvwilson