Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 76232ea

Browse files
committed
updated docstring
1 parent 3d6f1bd commit 76232ea

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

plotly/offline/offline.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,23 @@ def init_notebook_mode(connected=False):
5555
5656
Keyword arguments:
5757
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.
58+
connected (default=False) -- If True, the plotly.js library will be loaded
59+
from an online CDN. If False, the plotly.js library will be loaded locally
60+
from the plotly python package
61+
62+
Use `connected=True` if you want your notebooks to have smaller file sizes.
63+
In the case where `connected=False`, the entirety of the plotly.js library
64+
will be loaded into the notebook, which will result in a file-size increase
65+
of a couple megabytes. Additionally, because the library will be downloaded
66+
from the web, you and your viewers must be connected to the internet to be
67+
able to view charts within this notebook.
68+
69+
Use `connected=False` if you want you and your collaborators to be able to
70+
create and view these charts regardless of the availability of an internet
71+
connection. This is the default option since it is the most predictable.
72+
Note that under this setting the library will be included inline inside
73+
your notebook, resulting in much larger notebook sizes compared to the case
74+
where `connected=True`.
6175
"""
6276
if not _ipython_imported:
6377
raise ImportError('`iplot` can only run inside an IPython Notebook.')
@@ -71,6 +85,7 @@ def init_notebook_mode(connected=False):
7185
'<script>'
7286
'requirejs.config({'
7387
'paths: { '
88+
# Note we omit the extension .js because require will include it.
7489
'\'plotly\': [\'https://cdn.plot.ly/plotly-latest.min\']},'
7590
'});'
7691
'if(!window.Plotly) {{'

0 commit comments

Comments
 (0)