diff --git a/plotly/offline/offline.py b/plotly/offline/offline.py index d9c88c9b506..98b00066bb7 100644 --- a/plotly/offline/offline.py +++ b/plotly/offline/offline.py @@ -204,9 +204,9 @@ def init_notebook_mode(connected=False): # Note we omit the extension .js because require will include it. '\'plotly\': [\'https://cdn.plot.ly/plotly-latest.min\']}},' '}});' - 'if(!window.Plotly) {{' + 'if(!window._Plotly) {{' 'require([\'plotly\'],' - 'function(plotly) {{window.Plotly=plotly;}});' + 'function(plotly) {{window._Plotly=plotly;}});' '}}' '' ).format(win_config=_window_plotly_config, @@ -217,12 +217,12 @@ def init_notebook_mode(connected=False): '{win_config}' '{mathjax_config}' '' diff --git a/plotly/tests/test_optional/test_jupyter/js_tests/connected_false.js b/plotly/tests/test_optional/test_jupyter/js_tests/connected_false.js index bcb500aa769..95ae5ce10d0 100644 --- a/plotly/tests/test_optional/test_jupyter/js_tests/connected_false.js +++ b/plotly/tests/test_optional/test_jupyter/js_tests/connected_false.js @@ -24,7 +24,7 @@ test('should inject raw plotly.js code into DOM', function(t) { nodes = Array.prototype.slice.call(nodes, 0, 10); var results = nodes.filter(function(node) { - return node.innerHTML.substr(0, 19) === 'if(!window.Plotly){'; + return node.innerHTML.substr(0, 20) === 'if(!window._Plotly){'; }); t.equal(results.length, 1);