Skip to content

Commit 9a55018

Browse files
Merge pull request #3211 from plotly/rm_latest
2 parents be0dbc5 + d99060f commit 9a55018

File tree

3 files changed

+9
-37
lines changed

3 files changed

+9
-37
lines changed

CHANGELOG.md

+6-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

55

6-
## [4.14.3] - 2021-01-12
6+
## UNRELEASED
77

8-
### Fixed
9-
- Plotly.js cdn url will now be versioned by default for:
10-
`include_plotlyjs='cdn'` a new `include_plotlyjs='cdn-latest'` option
11-
has the original behaviour. Prevents likelihood of htmls generated with older
12-
`plotly.js` versions breaking with version bumps.
13-
[2961](https://github.com/plotly/plotly.py/pull/2961)
8+
### Changed
9+
10+
- Plotly.js CDN url will now be versioned by default for HTML exports using `include_plotlyjs='cdn'` and for "connected" renderers.
11+
12+
## [4.14.3] - 2021-01-12
1413

1514
- `px.timeline()` now allows `hover_data` formatting of start and end times [3018](https://github.com/plotly/plotly.py/pull/3018)
1615
- Small change to packaging of `plotlywidget` extension for JupyterLab 3 [3021](https://github.com/plotly/plotly.py/pull/3021)

packages/python/plotly/plotly/io/_html.py

+2-17
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,6 @@ def to_html(
6666
generated with include_plotlyjs=True, but they require an active
6767
internet connection in order to load the plotly.js library.
6868
69-
If 'cdn-latest', a script tag that always references the latest plotly.js
70-
CDN is included in the output.
71-
HTML files generated with this option are about 3MB smaller than those
72-
generated with include_plotlyjs=True, but they require an active
73-
internet connection in order to load the plotly.js library.
74-
7569
If 'directory', a script tag is included that references an external
7670
plotly.min.js bundle that is assumed to reside in the same
7771
directory as the HTML file.
@@ -272,15 +266,12 @@ def to_html(
272266
require_start = 'require(["plotly"], function(Plotly) {'
273267
require_end = "});"
274268

275-
elif include_plotlyjs == "cdn" or include_plotlyjs == "cdn-latest":
276-
cdn_url = plotly_cdn_url()
277-
if include_plotlyjs == "cdn-latest":
278-
cdn_url = plotly_cdn_url(cdn_ver="latest")
269+
elif include_plotlyjs == "cdn":
279270
load_plotlyjs = """\
280271
{win_config}
281272
<script src="{cdn_url}"></script>\
282273
""".format(
283-
win_config=_window_plotly_config, cdn_url=cdn_url
274+
win_config=_window_plotly_config, cdn_url=plotly_cdn_url()
284275
)
285276

286277
elif include_plotlyjs == "directory":
@@ -431,12 +422,6 @@ def write_html(
431422
generated with include_plotlyjs=True, but they require an active
432423
internet connection in order to load the plotly.js library.
433424
434-
If 'cdn-latest', a script tag that always references the latest plotly.js
435-
CDN is included in the output.
436-
HTML files generated with this option are about 3MB smaller than those
437-
generated with include_plotlyjs=True, but they require an active
438-
internet connection in order to load the plotly.js library.
439-
440425
If 'directory', a script tag is included that references an external
441426
plotly.min.js bundle that is assumed to reside in the same
442427
directory as the HTML file. If `file` is a string to a local file

packages/python/plotly/plotly/tests/test_io/test_html.py

+1-13
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,7 @@ def fig1(request):
3434

3535
# HTML
3636
# ----
37-
def assert_latest_cdn_connected(html):
38-
assert plotly_cdn_url(cdn_ver="latest") in html
39-
40-
41-
def assert_locked_version_cdn_connected(html):
42-
assert plotly_cdn_url() in html
43-
44-
45-
def test_latest_cdn_included(fig1):
46-
html_str = pio.to_html(fig1, include_plotlyjs="cdn-latest")
47-
assert_latest_cdn_connected(html_str)
4837

4938

5039
def test_versioned_cdn_included(fig1):
51-
html_str = pio.to_html(fig1, include_plotlyjs="cdn")
52-
assert_locked_version_cdn_connected(html_str)
40+
assert plotly_cdn_url() in pio.to_html(fig1, include_plotlyjs="cdn")

0 commit comments

Comments
 (0)