Remove references to plotly.js CDN and requirejs#4762
Closed
marthacryan wants to merge 6 commits intomasterfrom
Closed
Remove references to plotly.js CDN and requirejs#4762marthacryan wants to merge 6 commits intomasterfrom
marthacryan wants to merge 6 commits intomasterfrom
Conversation
Latest plotly.js used to be on a CDN, but it isn't anymore.
archmoj
reviewed
Sep 11, 2024
|
|
||
| If 'cdn', a script tag that references the plotly.js CDN is included | ||
| in the output. The url used is versioned to match the bundled plotly.js. | ||
| HTML files generated with this option are about 3MB smaller than those |
Contributor
There was a problem hiding this comment.
I think we should keep cdn option as it could help reduce smaller HTML files.
But for loading that we shouldn't use requirejs.
Collaborator
Author
There was a problem hiding this comment.
Oh ok - but we don't have a cdn currently right?
Contributor
There was a problem hiding this comment.
Yes we publish every version to CDN.
It's only the -latest version is no longer updated (plotly/plotly.js#5697) since plotly.js v2 and stayed as latest v1 version i.e. 1.58.5.
So we should be able to continue loading from CDN by specifying the exact version.
To achieve that you could add a separate script tag instead of requirejs to load e.g.
<script src="https://cdn.plot.ly/plotly-2.35.1.min.js" charset="utf-8"></script>Or alternatively for async loading
<script type="module">
import "https://cdn.plot.ly/plotly-2.35.2.min.js"
Plotly.newPlot("gd", [{ y: [1, 2, 3] }])
</script>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This removes references in the base renderers to the CDN and requirejs.
window._Plotlybecause that appears to be unusedThis should fix #4336.