File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 30
30
_matplotlib_imported = False
31
31
32
32
__PLOTLY_OFFLINE_INITIALIZED = False
33
- __PLOTLY_USE_CDN = False
34
33
35
34
36
35
def download_plotlyjs (download_url ):
@@ -53,14 +52,17 @@ def init_notebook_mode(connected=False):
53
52
Initialize plotly.js in the browser if it hasn't been loaded into the DOM
54
53
yet. This is an idempotent method and can and should be called from any
55
54
offline methods that require plotly.js to be loaded into the notebook dom.
55
+
56
+ Keyword arguments:
57
+
58
+ connected (default=False) -- if connected is True, this means that the
59
+ plotly.js library will be loaded from a CDN(online) rather than the
60
+ local file from pip.
56
61
"""
57
62
if not _ipython_imported :
58
63
raise ImportError ('`iplot` can only run inside an IPython Notebook.' )
59
64
60
65
global __PLOTLY_OFFLINE_INITIALIZED
61
- global __PLOTLY_USE_CDN
62
-
63
- __PLOTLY_USE_CDN = connected
64
66
65
67
if connected :
66
68
# Inject plotly.js into the output cell
@@ -76,7 +78,7 @@ def init_notebook_mode(connected=False):
76
78
'function(plotly) {window.Plotly=plotly;});'
77
79
'}}'
78
80
'</script>'
79
- )
81
+ )
80
82
else :
81
83
# Inject plotly.js into the output cell
82
84
script_inject = (
You can’t perform that action at this time.
0 commit comments