Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 283ba58

Browse filesBrowse files
committed
Merge pull request plotly#379 from joshburkart/patch-1
Change to offline.init_notebook_mode()
2 parents e3b0167 + 577177c commit 283ba58
Copy full SHA for 283ba58

File tree

1 file changed

+9
-8
lines changed
Filter options

1 file changed

+9
-8
lines changed

‎plotly/offline/offline.py

Copy file name to clipboardExpand all lines: plotly/offline/offline.py
+9-8Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,16 @@ def init_notebook_mode():
6060
from IPython.display import HTML, display
6161

6262
global __PLOTLY_OFFLINE_INITIALIZED
63+
if not __PLOTLY_OFFLINE_INITIALIZED:
64+
display(HTML('<script type="text/javascript">' +
65+
# ipython's includes `require` as a global, which
66+
# conflicts with plotly.js. so, unrequire it.
67+
'require=requirejs=define=undefined;' +
68+
'</script>' +
69+
'<script type="text/javascript">' +
70+
get_plotlyjs() +
71+
'</script>'))
6372
__PLOTLY_OFFLINE_INITIALIZED = True
64-
display(HTML('<script type="text/javascript">' +
65-
# ipython's includes `require` as a global, which
66-
# conflicts with plotly.js. so, unrequire it.
67-
'require=requirejs=define=undefined;' +
68-
'</script>' +
69-
'<script type="text/javascript">' +
70-
get_plotlyjs() +
71-
'</script>'))
7273

7374

7475
def _plot_html(figure_or_data, show_link, link_text,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.