From 78f33e7110985d5fac2e542b3e2e2611adfc64a6 Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Tue, 30 Oct 2018 18:42:39 -0400 Subject: [PATCH 1/2] Review updates --- plotly/offline/offline.py | 8 ++++---- .../test_jupyter/js_tests/connected_false.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) 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..181895814ea 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, 19) === 'if(!window._Plotly){'; }); t.equal(results.length, 1); From ec92c08642039079b31a1ba0792f95ea45e7af3c Mon Sep 17 00:00:00 2001 From: Jon Mease Date: Tue, 30 Oct 2018 19:02:40 -0400 Subject: [PATCH 2/2] Fix jupyter notebook iplot test --- .../test_optional/test_jupyter/js_tests/connected_false.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 181895814ea..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);