Skip to content

Commit ab2931d

Browse files
committed
rm pop up message when downloading image offline
1 parent febe6f4 commit ab2931d

File tree

1 file changed

+19
-23
lines changed

1 file changed

+19
-23
lines changed

plotly/offline/offline.py

Lines changed: 19 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,25 +71,17 @@ def get_image_download_script(caller):
7171
raise ValueError('caller should only be one of `iplot` or `plot`')
7272

7373
return(
74-
('<script>'
75-
'function downloadimage(format, height, width,'
76-
' filename) {{'
77-
'var p = document.getElementById(\'{plot_id}\');'
78-
'Plotly.downloadImage(p, {{format: format, height: height, '
79-
'width: width, filename: filename}});'
80-
'}};' +
81-
check_start +
82-
'if(confirm(\'Do you want to save this image as '
83-
'{filename}.{format}?\\n\\n'
84-
'For higher resolution images and more export options, '
85-
'consider making requests to our image servers. Type: '
86-
'help(py.image) for more details.'
87-
'\')) {{'
88-
'downloadimage(\'{format}\', {height}, {width}, '
89-
'\'{filename}\');}}' +
90-
check_end +
91-
'</script>'
92-
)
74+
('<script>'
75+
'function downloadimage(format, height, width,'
76+
' filename) {{'
77+
'var p = document.getElementById(\'{plot_id}\');'
78+
'Plotly.downloadImage(p, {{format: format, height: height, '
79+
'width: width, filename: filename}});}};' +
80+
check_start +
81+
'{{downloadimage(\'{format}\', {height}, {width}, '
82+
'\'{filename}\');}}' +
83+
check_end +
84+
'</script>')
9385
)
9486

9587

@@ -311,7 +303,9 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
311303
image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets
312304
the format of the image to be downloaded, if we choose to download an
313305
image. This parameter has a default value of None indicating that no
314-
image should be downloaded.
306+
image should be downloaded. Please note: for higher resolution images
307+
and more export options, consider making requests to our image servers.
308+
Type: `help(py.image)` for more details.
315309
filename (default='plot') -- Sets the name of the file your image
316310
will be saved to. The extension should not be included.
317311
image_height (default=600) -- Specifies the height of the image in `px`.
@@ -425,9 +419,11 @@ def plot(figure_or_data,
425419
image (default=None |'png' |'jpeg' |'svg' |'webp') -- This parameter sets
426420
the format of the image to be downloaded, if we choose to download an
427421
image. This parameter has a default value of None indicating that no
428-
image should be downloaded.
429-
image_filename (default='plot_image') -- Sets the name of the file your image
430-
will be saved to. The extension should not be included.
422+
image should be downloaded. Please note: for higher resolution images
423+
and more export options, consider making requests to our image servers.
424+
Type: `help(py.image)` for more details.
425+
image_filename (default='plot_image') -- Sets the name of the file your
426+
image will be saved to. The extension should not be included.
431427
image_height (default=600) -- Specifies the height of the image in `px`.
432428
image_width (default=800) -- Specifies the width of the image in `px`.
433429
"""

0 commit comments

Comments
 (0)