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

Skip to content

Commit c32be7a

Browse files
committed
Require plotly to ensure it is defined when building plot HTML in offline mode.
1 parent 2594076 commit c32be7a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

plotly/offline/offline.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,11 @@ def _plot_html(figure_or_data, show_link, link_text,
127127
'class="plotly-graph-div">'
128128
'</div>'
129129
'<script type="text/javascript">'
130+
'require(["plotly"], function(Plotly) {{'
130131
'window.PLOTLYENV=window.PLOTLYENV || {{}};'
131132
'window.PLOTLYENV.BASE_URL="' + plotly_platform_url + '";'
132133
'{script}'
134+
'}});'
133135
'</script>'
134136
'').format(
135137
id=plotdivid, script=script,

0 commit comments

Comments
 (0)