Skip to content

Commit 4cbbc80

Browse files
committed
removed the use of global variable __PLOTLY_USE_CDN, added keyword to docstring;
1 parent 8822ff4 commit 4cbbc80

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

plotly/offline/offline.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
_matplotlib_imported = False
3131

3232
__PLOTLY_OFFLINE_INITIALIZED = False
33-
__PLOTLY_USE_CDN = False
3433

3534

3635
def download_plotlyjs(download_url):
@@ -53,14 +52,17 @@ def init_notebook_mode(connected=False):
5352
Initialize plotly.js in the browser if it hasn't been loaded into the DOM
5453
yet. This is an idempotent method and can and should be called from any
5554
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.
5661
"""
5762
if not _ipython_imported:
5863
raise ImportError('`iplot` can only run inside an IPython Notebook.')
5964

6065
global __PLOTLY_OFFLINE_INITIALIZED
61-
global __PLOTLY_USE_CDN
62-
63-
__PLOTLY_USE_CDN = connected
6466

6567
if connected:
6668
# Inject plotly.js into the output cell
@@ -76,7 +78,7 @@ def init_notebook_mode(connected=False):
7678
'function(plotly) {window.Plotly=plotly;});'
7779
'}}'
7880
'</script>'
79-
)
81+
)
8082
else:
8183
# Inject plotly.js into the output cell
8284
script_inject = (

0 commit comments

Comments
 (0)