Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add intro animations to basic plotly charts #7422

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
devxpy opened this issue May 19, 2025 · 2 comments
Open

Add intro animations to basic plotly charts #7422

devxpy opened this issue May 19, 2025 · 2 comments
Labels
community community contribution feature something new P1 needed for current cycle

Comments

@devxpy
Copy link

devxpy commented May 19, 2025

A lot of modern JS charting libraries support intro animations like these:

Screen.Recording.2025-05-19.at.2.02.10.PM.mov

I love using Plotly as a Pythonista and would like to make it look modern and fancy like the other charting libraries.

Does plotly have intro animations out of the box? If not, would this be relatively simple for me to add as a contributor to plotly.js? I am pretty proficient with javascript and can help.

My thought was to add this to the basic charts like go.Bar go.Pie & go.Scatter with a flag like enable_intro_anims so users can enable/disable them as per their choice.


I asked cursor to give me some sample code for how this can be done, and it looks like Plotly.animate can achieve this!

Screen.Recording.2025-05-19.at.2.28.48.PM.mov

Here's the code - https://jsfiddle.net/am6914fb/5/

@ndrezn
Copy link
Member

ndrezn commented May 19, 2025

Love the idea! It's always nice to expose functionality that exists with a more accessible API.

Where are you thinking within the figure object this flag could be added? It might make sense to live in the layout object as a top-level parameter 🤔 @alexcjohnson do you know if this is an idea we've considered in the past?

@ndrezn
Copy link
Member

ndrezn commented May 20, 2025

For context, it was an active design decision to not add startup animations to Plotly charts (which are most often used in a scientific context, where animations might not make sense: for example, it would get old to see the same animation re-run every time you execute a Jupyter cell). To that end if added, startup animations should be opt-in rather than opt-out.

@gvwilson gvwilson added feature something new community community contribution P1 needed for current cycle labels May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community community contribution feature something new P1 needed for current cycle
Projects
None yet
Development

No branches or pull requests

3 participants