File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -49,9 +49,16 @@ modeBarButtons.toImage = {
4949 title : 'Download plot as a png' ,
5050 icon : Icons . camera ,
5151 click : function ( gd ) {
52+ var format = 'png' ;
53+
5254 Lib . notifier ( 'Taking snapshot - this may take a few seconds' , 'long' ) ;
5355
54- downloadImage ( gd )
56+ if ( Lib . isIE ( ) ) {
57+ Lib . notifier ( 'IE only supports svg. Changing format to svg.' , 'long' ) ;
58+ format = 'svg' ;
59+ }
60+
61+ downloadImage ( gd , { 'format' :format } )
5562 . then ( function ( filename ) {
5663 Lib . notifier ( 'Snapshot succeeded - ' + filename , 'long' ) ;
5764 } )
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ function downloadImage(gd, opts) {
4040 // does not allow toDataURL
4141 // svg format will work though
4242 if ( Lib . isIE ( ) && opts . format !== 'svg' ) {
43- reject ( new Error ( 'Sorry IE does not support downloading from canvas.' ) ) ;
43+ reject ( new Error ( 'Sorry IE does not support downloading from canvas. Try {format:"svg"} instead. ' ) ) ;
4444 }
4545
4646 gd . _snapshotInProgress = true ;
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ function svgToImg(opts) {
3535 // Leave here just in case the CORS/tainted IE issue gets resolved
3636 if ( Lib . isIE ( ) ) {
3737 // replace double quote with single quote
38- svg = svg . replace ( / " / gi, "'" ) ;
38+ svg = svg . replace ( / " / gi, '\'' ) ;
3939 // url in svg are single quoted
4040 // since we changed double to single
4141 // we'll need to change these to double-quoted
You can’t perform that action at this time.
0 commit comments