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 127ebc5

Browse filesBrowse files
committed
Don't clobber the Notebook's require/requirejs/define instances
1 parent 0dded42 commit 127ebc5
Copy full SHA for 127ebc5

File tree

1 file changed

+7
-7
lines changed
Filter options

1 file changed

+7
-7
lines changed

‎plotly/offline/offline.py

Copy file name to clipboardExpand all lines: plotly/offline/offline.py
+7-7Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ def init_notebook_mode():
6161

6262
global __PLOTLY_OFFLINE_INITIALIZED
6363
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">' +
64+
display(HTML("<script type='text/javascript'>" +
65+
"define('plotly', function(require, exports, module) {" +
7066
get_plotlyjs() +
71-
'</script>'))
67+
"});" +
68+
"require(['plotly'], function(Plotly) {" +
69+
"window.Plotly = Plotly;" +
70+
"});" +
71+
"</script>"))
7272
__PLOTLY_OFFLINE_INITIALIZED = True
7373

7474

0 commit comments

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