Closed Gilotto closed 4 years ago
Hi @Gilotto,
I just added support to programmatically download images, you can see an example here.
Unfortunately, plotly.js doesn't have a headless mode, so bulk downloading is only possible if the graphs are mounted in the DOM.
If your data is static, you could automate creating the images using something like puppeteer.
Hey @Shmew, thanks for your quick reply! Looks good tot me. I'll test it next week, after the holidays here.
Hey @Shmew,
Thanks for the inclusion of the download function!
It it possible to include the path to download the file to in the downloadImage function as a parameter? e.g. path = C:/Users/#Name/Documents
Or alternatively, can the downloadImage function return a link to the plot image?
I can only expose what plotly.js has, so what you see is what you get with the downloadImage
function unfortunately. If this is helpful I can certainly add it as well.
I didn't know about the toImage function. Looks like the thing I can use. Can you please expose this function too? Thanks!
I just published 1.1.0 which adds the Plotly.toImage
function. That same example above was update to show how it can be used.
Thanks for the update and the example. I got the toImage function working now!
For my project I'm using Feliz and Plotly to generate nice plots for display in the GUI.
Now we want to save the plots to a location on the disk. We can use the 'save to png' button, but that is just 1 plot. We want to generate and save the plots to disk on one click, or even without user interaction. How can we achieve this?
I noticed a 'callback event' onBeforeExport in the code. Is this the event that is used to handle the 'save to png' button?