File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -329,7 +329,7 @@ def release_zoom(self, event):
329329
330330 def save_figure (self , * args ):
331331 """Save the current figure"""
332- warnings . warn ( '"Save figure" not implemented in Web Backend ' )
332+ self . canvas . send_event ( 'save ' )
333333
334334
335335class FigureManagerWebAgg (backend_bases .FigureManagerBase ):
Original file line number Diff line number Diff line change @@ -283,6 +283,14 @@ mpl.figure.prototype.send_draw_message = function() {
283283 }
284284}
285285
286+
287+ mpl . figure . prototype . handle_save = function ( fig , msg ) {
288+ var format_dropdown = fig . format_dropdown ;
289+ var format = format_dropdown . options [ format_dropdown . selectedIndex ] . value ;
290+ fig . ondownload ( fig , format ) ;
291+ }
292+
293+
286294mpl . figure . prototype . handle_resize = function ( fig , msg ) {
287295 var size = msg [ 'size' ] ;
288296 if ( size [ 0 ] != fig . canvas . width || size [ 1 ] != fig . canvas . height ) {
You can’t perform that action at this time.
0 commit comments