@@ -449,7 +449,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
449
449
in a standalone HTML file.
450
450
Use 'div' if you are embedding these graphs in an HTML file with
451
451
other graphs or HTML markup, like a HTML report or an website.
452
- include_plotlyjs (True | False | 'cdn' | 'directory' - default=True) --
452
+ include_plotlyjs (True | False | 'cdn' | 'directory' | path - default=True)
453
453
Specifies how the plotly.js library is included in the output html
454
454
file or div string.
455
455
@@ -475,6 +475,10 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
475
475
the same directory because the plotly.js source code will be included
476
476
only once per output directory, rather than once per output file.
477
477
478
+ If a string that ends in '.js', a script tag is included that
479
+ references the specified path. This approach can be used to point
480
+ the resulting HTML file to an alternative CDN.
481
+
478
482
If False, no script tag referencing plotly.js is included. This is
479
483
useful when output_type='div' and the resulting div string will be
480
484
placed inside an HTML document that already loads plotly.js. This
@@ -530,6 +534,10 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
530
534
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>"""
531
535
elif include_plotlyjs == 'directory' :
532
536
plotly_js_script = '<script src="plotly.min.js"></script>'
537
+ elif (isinstance (include_plotlyjs , six .string_types ) and
538
+ include_plotlyjs .endswith ('.js' )):
539
+ plotly_js_script = '<script src="{url}"></script>' .format (
540
+ url = include_plotlyjs )
533
541
elif include_plotlyjs :
534
542
plotly_js_script = '' .join ([
535
543
'<script type="text/javascript">' ,
0 commit comments