Skip to content

[Bug] Hovertemplate not persisted after animation #2722

Closed
@ogelin

Description

@ogelin

I've noticed this issue using Plotly with Dash & also reproduced in my own Jupyter notebook.

Here is a code sample reproducing the issue :

import plotly.express as px
df = px.data.gapminder()

fig = px.scatter(df, x="gdpPercap", y="lifeExp",
	         size="pop", color="continent", animation_frame='year', animation_group='country',
                 hover_name="country", log_x=True, size_max=60)

fig.update_traces(
        hovertemplate='<span>hi!!</span>',
    )

fig.show()

When the figure is initially loaded, the tooltips show my custom hover template. After the animation, my hover template is no longer in use and the tooltips show their initial content (i.e. the property names followed by an equal sign & their value).

Before animation:
image

After animation:
image

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