Skip to content

Commit

Permalink
Don't clobber the Notebook's require/requirejs/define instances
Browse files Browse the repository at this point in the history
  • Loading branch information
jdfreder committed Feb 23, 2016
1 parent 0dded42 commit 127ebc5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions plotly/offline/offline.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ def init_notebook_mode():

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">' +
display(HTML("<script type='text/javascript'>" +
"define('plotly', function(require, exports, module) {" +
get_plotlyjs() +
'</script>'))
"});" +
"require(['plotly'], function(Plotly) {" +
"window.Plotly = Plotly;" +
"});" +
"</script>"))
__PLOTLY_OFFLINE_INITIALIZED = True


Expand Down

0 comments on commit 127ebc5

Please sign in to comment.