plotly / dash-core-components

OBSOLETE: now part of https://github.com/plotly/dash
https://dash.plotly.com
MIT License
270 stars 147 forks source link

hovertext re-appears after "playing" an animation #1001

Open zadamg opened 1 year ago

zadamg commented 1 year ago

Simple as the title.. no callback is firing to update; it's just the in-line Express animator. Just make a px.Scatter with an animation_group and slider, then update the layout before rendering:

fig.update_traces(hoverinfo="none", hovertemplate=None, hovertext=None)

Then play the animation and hover over a point and the hovertext has reappeared. Expected behavior would be to stay hidden, as there's nothing asking hovertext to be re-enabled after explicitly updating all traces not to have one.

Here's the behavior: https://i.postimg.cc/8CL7VtV1/issue-plotly.gif

Here's the slider/button I created. Sadly, I don't have a minimally re-producable example, but it should be easy enough to recreate.

fig.update_layout(
        sliders=[
            dict(
                currentvalue=dict(
                    prefix="Date: ",
                    visible=True,
                ),
                transition={"duration": 800, "easing": "cubic-in-out"},
                len=0.98,
                x=0.02,
                y=0,
                steps=[],
            )
        ],
        updatemenus=[
            dict(
                type="buttons",
                direction="down",
                buttons=list(
                    [
                        dict(
                            args=[
                                None,
                                {
                                    "frame": {"duration": 1400, "redraw": False},
                                    "fromcurrent": True,
                                    "transition": {
                                        "duration": 1400,
                                        "easing": "cubic-in-out",
                                    },
                                },
                            ],
                            label="Play",
                            method="animate",
                        ),
                        dict(
                            args=[
                                [None],
                                {
                                    "frame": {"duration": 0, "redraw": False},
                                    "mode": "immediate",
                                    "transition": {"duration": 0},
                                },
                            ],
                            label="Pause",
                            method="animate",
                        ),
                    ]
                ),
                showactive=False,
                x=-0.1,
                xanchor="left",
                y=-0.4,
                yanchor="bottom",
            )
        ],
    )