Skip to content

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

```
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?

plotly.offline.offline.__PLOTLY_OFFLINE_INITIALIZED = False
pass

@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.

5 participants