Skip to content
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

Interface with animation options in Plotly.js #1496

Closed
TakodaS opened this issue Apr 5, 2019 · 3 comments
Closed

Interface with animation options in Plotly.js #1496

TakodaS opened this issue Apr 5, 2019 · 3 comments

Comments

@TakodaS
Copy link
Contributor

TakodaS commented Apr 5, 2019

Currently there is no option to access the animation options of Plotly.js from python. This makes it extremely difficult to make proper animations since the default time between frames in 500ms. I have added an extra keyword argument to offline.plot and offline.iplot called animation opts which allows the user to pass a python dictionary through and thus customize animations.

animation_opts (default=None) -- Custom animation parameters to be passed
    to the function Plotly.animate in Plotly.js in the form str(dict)
    Example:


from plotly.offline import plot
    figure = {'data': [{'x': [0, 1], 'y': [0, 1]}],
              'layout': {'xaxis': {'range': [0, 5], 'autorange': False},
                         'yaxis': {'range': [0, 5], 'autorange': False},
                         'title': 'Start Title'},
              'frames': [{'data': [{'x': [1, 2], 'y': [1, 2]}]},
                         {'data': [{'x': [1, 4], 'y': [1, 4]}]},
                         {'data': [{'x': [3, 4], 'y': [3, 4]}],
                          'layout': {'title': 'End Title'}}]}
    plot(figure,animation_opts="{frame: {duration: 1}}")

https://github.com/TakodaS/plotly.py

@jonmmease
Copy link
Contributor

Hi @TakodaS, this sounds like a fine option to add. Feel free to open a pull request if you already have an implementation to start with 🙂 Although it would need to be reworked a little once we merge #1474, which will hopefully be this week.

@TakodaS
Copy link
Contributor Author

TakodaS commented Apr 9, 2019

#1503 Done.

@gvwilson
Copy link
Contributor

Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants