You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Downloading a plotly plot as png in python interactive does not appear to actually save anywhere #3147
After generating a plotly plot in Python Interactive, I want to save/download the plot as a png. I click on the little camera icon to “download plot as a png”. Two small screens appear saying “taking a snapshot, this may take a few seconds” then “Snapshot succeeded - newplot.png”. I would expect that file to then exist in my workspace.
Actual behaviour
The file does not appear in my workspace, and searching on my computer does not show any file existing.
Steps to reproduce:
Generate plotly plot in python interactive window.
SO is saying yes, we can override the link click. Just need to figure out what to do with it:
document.addEventListener('click', event => {
let node = event && event.target;
while (node) {
if (node.tagName && node.tagName === 'A' && node.href) {
// Handle click here by posting data back to VS Code
// for your extension to handle
vscode.postMessage({ ... });
event.preventDefault();
return;
}
node = node.parentNode;
}
}, true);``
Activity
rchiodo commentedon Sep 6, 2019
I believe this is a limitation of the webview API of VS Code (which the plotly code is running inside of)
It looks like under the covers plotly is doing this:
(https://github.com/plotly/plotly.js/blob/7e789b35e9daa5ca8243febe0027d29d402ff772/src/snapshot/filesaver.js#L55)
We might be able to override the 'saveLink' on a document node, not sure.
rchiodo commentedon Sep 6, 2019
SO is saying yes, we can override the link click. Just need to figure out what to do with it:
DonJayamanne commentedon Nov 21, 2019
Validated