Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove cdn option for include_plotlyjs
  • Loading branch information
marthacryan committed Sep 11, 2024
commit 3a8bf77a9e34f27acafd97687ca18ebc47379486
6 changes: 0 additions & 6 deletions packages/python/plotly/plotly/basedatatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3524,12 +3524,6 @@ def to_html(self, *args, **kwargs):
is included in the output. HTML files generated with this option are
fully self-contained and can be used offline.

If 'cdn', a script tag that references the plotly.js CDN is included
in the output. HTML files generated with this option are about 3MB
smaller than those generated with include_plotlyjs=True, but they
require an active internet connection in order to load the plotly.js
library.

If 'directory', a script tag is included that references an external
plotly.min.js bundle that is assumed to reside in the same
directory as the HTML file.
Expand Down
10 changes: 2 additions & 8 deletions packages/python/plotly/plotly/io/_base_renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,6 @@ def to_mimebundle(self, fig_dict):
if self.requirejs:
include_plotlyjs = "require"
include_mathjax = False
elif self.connected:
include_plotlyjs = "cdn"
include_mathjax = "cdn"
else:
include_plotlyjs = True
include_mathjax = "cdn"
Expand Down Expand Up @@ -760,7 +757,7 @@ def __init__(
auto_play=False,
post_script=None,
animation_opts=None,
include_plotlyjs="cdn",
include_plotlyjs=True,
):

self.config = config
Expand Down Expand Up @@ -840,9 +837,6 @@ def to_mimebundle(self, fig_dict):
if self.requirejs:
include_plotlyjs = "require"
include_mathjax = False
elif self.connected:
include_plotlyjs = "cdn"
include_mathjax = "cdn"
else:
include_plotlyjs = True
include_mathjax = "cdn"
Expand Down Expand Up @@ -875,7 +869,7 @@ def render(self, fig_dict):
filename_html = filename_root + ".html"
filename_png = filename_root + ".png"
figure = return_figure_from_figure_or_data(fig_dict, True)
_ = write_html(fig_dict, file=filename_html, include_plotlyjs="cdn")
_ = write_html(fig_dict, file=filename_html, include_plotlyjs=True)
try:
write_image(figure, filename_png)
except (ValueError, ImportError):
Expand Down