@@ -31,8 +31,7 @@ mpl.mpl_figure_comm = function(comm, msg) {
31
31
var ws_proxy = comm_websocket_adapter ( comm )
32
32
33
33
function ondownload ( figure , format ) {
34
- var canvasData = figure . canvas . toDataURL ( "image/" + format ) ;
35
- window . open ( canvasData ) ;
34
+ window . open ( figure . imageObj . src ) ;
36
35
}
37
36
38
37
var fig = new mpl . figure ( id , ws_proxy ,
@@ -113,21 +112,6 @@ mpl.figure.prototype._init_toolbar = function() {
113
112
nav_element . append ( button ) ;
114
113
}
115
114
116
- var fmt_picker_span = $ ( '<span/>' ) ;
117
-
118
- var fmt_picker = $ ( '<select width="75" style="width: 75px; margin-top: 10px"</select>' ) ;
119
- fmt_picker . addClass ( 'mpl-toolbar-optionui-widget ui-widget-content' ) ;
120
- fmt_picker_span . append ( fmt_picker ) ;
121
- nav_element . append ( fmt_picker_span ) ;
122
- this . format_dropdown = fmt_picker [ 0 ] ;
123
-
124
- for ( var ind in mpl . extensions ) {
125
- var fmt = mpl . extensions [ ind ] ;
126
- var option = $ (
127
- '<option/>' , { selected : fmt === mpl . default_extension } ) . html ( fmt ) ;
128
- fmt_picker . append ( option )
129
- }
130
-
131
115
// Add the status bar.
132
116
var status_bar = $ ( '<span class="mpl-message" style="text-align:right; float: right;"/>' ) ;
133
117
nav_element . append ( status_bar ) ;
@@ -162,6 +146,11 @@ mpl.figure.prototype._canvas_extra_style = function(el){
162
146
}
163
147
164
148
149
+ mpl . figure . prototype . handle_save = function ( fig , msg ) {
150
+ fig . ondownload ( fig , null ) ;
151
+ }
152
+
153
+
165
154
mpl . find_output_cell = function ( html_output ) {
166
155
// Return the cell and output element which can be found *uniquely* in the notebook.
167
156
// Note - this is a bit hacky, but it is done because the "notebook_saving.Notebook"
0 commit comments