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

Skip to content

Change to offline.init_notebook_mode() #379

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 1 commit into from
Feb 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions plotly/offline/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,16 @@ def init_notebook_mode():
from IPython.display import HTML, display

global __PLOTLY_OFFLINE_INITIALIZED
if not __PLOTLY_OFFLINE_INITIALIZED:
display(HTML('<script type="text/javascript">' +
# ipython's includes `require` as a global, which
# conflicts with plotly.js. so, unrequire it.
'require=requirejs=define=undefined;' +
'</script>' +
'<script type="text/javascript">' +
get_plotlyjs() +
'</script>'))
__PLOTLY_OFFLINE_INITIALIZED = True
display(HTML('<script type="text/javascript">' +
# ipython's includes `require` as a global, which
# conflicts with plotly.js. so, unrequire it.
'require=requirejs=define=undefined;' +
'</script>' +
'<script type="text/javascript">' +
get_plotlyjs() +
'</script>'))


def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
Expand Down