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
I had some behavior I thought was odd when using plotly.offline.plot(). I tracked down my answer here:
if image:
if image not in __IMAGE_FORMATS:
raise ValueError('The image parameter must be one of the '
'following: {}'.format(__IMAGE_FORMATS)
)
# if the check passes then download script is injected.
# write the download script:
script = get_image_download_script('plot')
script = script.format(format=image,
width=image_width,
height=image_height,
filename=image_filename,
plot_id=plotdivid)
else:
script = ''
If I have numerous plots to embed, send, generate, etc. and I want to give them unique image filenames but I don't want them auto-downloading the generated plot every time I open them. Could one pass a filename so that when a file is downloaded you don't end up with newplot (n).png?
Originally I thought this would be a simple case where you set the filename associated with the little camera button, but now I realize that gets tricky as how would you know the type?
One way would be to allow image_filename without image='type' and default to png. This is the current functionality, but you're allowing the name to be customized when you click the camera button.
Another route could be to add an option like auto_dl or auto_save that is analogous to auto_open for plot(). Namely, just because I plot, don't open the webpage; just because I want to specify an image name, don't download it every time I open the page.
The text was updated successfully, but these errors were encountered:
For your first option, the camera button functionality is associated with our core graphing library plotly.js changes to that would have to be made there rather in this repo so that functionality remains consistent across all of Plotly's APIs
Could you provide a use case for this second point? I'm not sure the auto_open analogy is appropriate here. When you choose to set auto_open to false, the plot is still generated and saved. It seems like in the case of setting auto_save=False there would be no resulting action so I'm not sure what benefit this option would provide.
The simple goal: I want to customize the image name, but I don't want an image to auto-download every time I open the file.
Currently, if I pass image, the Plotly.downloadImage script is injected, which means each time I open the .html, the plot image is downloaded. I don't want this; I just want it sitting there as custom-filename.png sitting and waiting for me to click. Sounds like it's not possible?
I think really what I want is image saving as a separate thing, which brings in #880 . Sounds like that's upcoming and I can have this: filename control and not have it integrated into the .html behavior.
I had some behavior I thought was odd when using
plotly.offline.plot()
. I tracked down my answer here:If I have numerous plots to embed, send, generate, etc. and I want to give them unique image filenames but I don't want them auto-downloading the generated plot every time I open them. Could one pass a filename so that when a file is downloaded you don't end up with
newplot (n).png
?Originally I thought this would be a simple case where you set the filename associated with the little camera button, but now I realize that gets tricky as how would you know the type?
One way would be to allow
image_filename
withoutimage='type'
and default topng
. This is the current functionality, but you're allowing the name to be customized when you click the camera button.Another route could be to add an option like
auto_dl
orauto_save
that is analogous toauto_open
forplot()
. Namely, just because I plot, don't open the webpage; just because I want to specify an image name, don't download it every time I open the page.The text was updated successfully, but these errors were encountered: