Skip to content

Ensure plotlyjs loaded #466

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

Merged
merged 6 commits into from
May 19, 2016
Merged

Ensure plotlyjs loaded #466

merged 6 commits into from
May 19, 2016

Conversation

mdtusz
Copy link
Contributor

@mdtusz mdtusz commented May 18, 2016

Fixes issues with offline mode not working after refreshes.

In Brief:

  • Check the DOM for plotly.js rather than the global flag in python
  • Load it on all offline notebook plot methods
  • Clean up some unused code and deprecate init_notebook_mode

@@ -171,25 +177,13 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',

Example:
```
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode()
from plotly.offline import, iplot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

random comma

'</script>'
'').format(script=get_plotlyjs())

display(HTML(script_inject))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐄 could use less escaping by following original formatting, but not needed!

@yankev
Copy link
Contributor

yankev commented May 18, 2016

Looks good to me! @theengineear Do you have time to look over this PR?


@raises(plotly.exceptions.PlotlyError)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@theengineear
Copy link
Contributor

Looks great! Thanks for doing that! 💃

@aggFTW
Copy link

aggFTW commented May 18, 2016

What release of plotly will have this issue? This is blocking our production use of plotly.
Thanks!

@mdtusz mdtusz merged commit 9ccc3c7 into master May 19, 2016
@mdtusz mdtusz deleted the ensure-plotlyjs-loaded branch May 19, 2016 14:40
@aggFTW
Copy link

aggFTW commented May 19, 2016

Thanks! I saw you pushed 👍

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

Successfully merging this pull request may close these issues.

4 participants