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

Allow users to control autoplay feature on Python animation frames #697

Closed
richard-muir opened this issue Feb 20, 2017 · 2 comments
Closed
Milestone

Comments

@richard-muir
Copy link

Hey all,

Loving the new animation functionality you've introduced!

It would be great if you could allow us to decide whether or not we want the animation to autoplay.

For example, your GapMinder plot created with the Python API here autoplays, whilst the same plot with .js here doesn't.

Cheers!

@mikapfl
Copy link

mikapfl commented Dec 12, 2017

Hi, just a quick comment for a workaround: If you have your plot in the pl1 object, you can get rid of autoplaying by:
pl1 = re.sub("\\.then\\(function\\(\\)\\{Plotly\\.animate\\(\\'[0-9a-zA-Z-]*\\'\\)\\;\\}\\)", "", pl1)

Full example:

pl1 = plot(fig, output_type='div')
pl1 = re.sub("\\.then\\(function\\(\\)\\{Plotly\\.animate\\(\\'[0-9a-zA-Z-]*\\'\\)\\;\\}\\)", "", pl1)
with open(fname, 'w') as fd:
    fd.write("""<html>
<head>
</head>
<body>
{}
</body>
</html>
""".format(pl1))

It is of course a hack, but does the job for me

@nicolaskruchten
Copy link
Contributor

(bump) this is indeed a bit odd... @jonmmease any insight into why things autoplay and what it might take for them not to? a flag in iplot()?

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

4 participants