Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0255406

Browse filesBrowse files
committed
removed window.Plotly check and removed extra conditions on optional require lines
1 parent 2461711 commit 0255406
Copy full SHA for 0255406

File tree

Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-6
lines changed

‎plotly/offline/offline.py

Copy file name to clipboardExpand all lines: plotly/offline/offline.py
+10-6Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ def init_notebook_mode(connected=False):
6767
script_inject = (
6868
''
6969
'<script>'
70-
'if(!window.Plotly) {{'
71-
'require([\'https://cdn.plot.ly/plotly-latest.min.js\'],'
70+
# 'if(!window.Plotly) {{'
71+
'requirejs.config({'
72+
'paths: { '
73+
'\'plotly\': [\'https://cdn.plot.ly/plotly-latest.min\']},'
74+
'});'
75+
'require([\'plotly\'],'
7276
'function(plotly) {window.Plotly=plotly;});'
73-
'}} </script>'
77+
# '}}'
78+
'</script>'
7479
)
7580
else:
7681
# Inject plotly.js into the output cell
@@ -142,9 +147,8 @@ def _plot_html(figure_or_data, show_link, link_text,
142147
config=jconfig)
143148

144149
optional_line1 = ('require(["plotly"], function(Plotly) {{ '
145-
if (global_requirejs and (not __PLOTLY_USE_CDN)) else '')
146-
optional_line2 = ('}});' if (global_requirejs and (not __PLOTLY_USE_CDN))
147-
else '')
150+
if global_requirejs else '')
151+
optional_line2 = ('}});' if global_requirejs else '')
148152

149153
plotly_html_div = (
150154
''

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.