@@ -449,7 +449,7 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
449449 in a standalone HTML file.
450450 Use 'div' if you are embedding these graphs in an HTML file with
451451 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)
453453 Specifies how the plotly.js library is included in the output html
454454 file or div string.
455455
@@ -475,6 +475,10 @@ def plot(figure_or_data, show_link=True, link_text='Export to plot.ly',
475475 the same directory because the plotly.js source code will be included
476476 only once per output directory, rather than once per output file.
477477
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+
478482 If False, no script tag referencing plotly.js is included. This is
479483 useful when output_type='div' and the resulting div string will be
480484 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',
530534 <script src="https://cdn.plot.ly/plotly-latest.min.js"></script>"""
531535 elif include_plotlyjs == 'directory' :
532536 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 )
533541 elif include_plotlyjs :
534542 plotly_js_script = '' .join ([
535543 '<script type="text/javascript">' ,
0 commit comments