Skip to content

Share chart button#7802

Open
emilykl wants to merge 25 commits into
masterfrom
upload-to-cloud-proto
Open

Share chart button#7802
emilykl wants to merge 25 commits into
masterfrom
upload-to-cloud-proto

Conversation

@emilykl

@emilykl emilykl commented May 14, 2026

Copy link
Copy Markdown
Contributor

Modify the existing sendDataToCloud modebar button to share the chart via Plotly Cloud rather than Chart Studio.

The button remains disabled by default. Note that the Chart Studio endpoint for receiving charts is not yet functional, so the full sharing feature is not yet ready, but the UI can be previewed by setting showSendToCloud: true in the plot config.

Since the Chart Studio website is no longer online, the existing "share to Cloud" logic was not functional, so this should not be a breaking change.

Codepen: https://codepen.io/emilykl-code/pen/XJNJVZa

@emilykl emilykl force-pushed the upload-to-cloud-proto branch from a487ce9 to 100da7b Compare May 14, 2026 17:16
@emilykl emilykl changed the title draft Share chart button May 20, 2026
@marthacryan marthacryan marked this pull request as ready for review May 28, 2026 20:38
@marthacryan marthacryan marked this pull request as draft May 28, 2026 20:40
@marthacryan marthacryan self-assigned this May 28, 2026
Comment thread src/components/modebar/cloud_confirm.js Outdated
Comment thread src/plot_api/plot_config.js Outdated
Comment thread src/plots/plots.js Outdated
Comment thread src/plots/plots.js Outdated
@marthacryan marthacryan marked this pull request as ready for review June 11, 2026 02:33
Comment thread src/components/modebar/cloud_confirm.js Outdated
Comment thread src/plots/plots.js Outdated
Comment on lines 204 to 205
plots.sendDataToCloud = function(gd) {
var baseUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably better to pass in baseUrl / serverUrl as an argument, so that we don't have to duplicate this (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL logic

Comment thread src/plots/plots.js
Comment thread src/components/modebar/buttons.js Outdated
icon: Icons.pencil,
click: function(gd) {
Plots.sendDataToCloud(gd);
var serverUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the URL validation steps (truthiness check and try { new URL(baseUrl).origin;}) should happen inside a validateURL function here, rather than inside Plots.sendDataToCloud(gd);, so that we don't even show the dialog at all if the URL is invalid.

Comment thread test/plot-schema.json
@emilykl emilykl force-pushed the upload-to-cloud-proto branch from 396b681 to c1b7122 Compare June 15, 2026 20:21
Comment thread src/components/modebar/cloud_confirm.js Outdated
Comment thread src/components/modebar/buttons.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants