@@ -126,14 +126,15 @@ export default {
126126 return Plotly .plot (this .$refs .container , this .data , this .internalLayout , this .options )
127127 },
128128 newPlot () {
129- var el = this .$refs .container ;
129+ var el = this .$refs .container
130+ let opts = this .options
130131
131- // if width/height is not specified for toImageButton, default to el.clientWidth/clientHeight
132- if ( ! this . options ) this . options = {};
133- if ( ! this . options . toImageButtonOptions ) this . options . toImageButtonOptions = {};
134- if ( ! this . options . toImageButtonOptions .width ) this . options . toImageButtonOptions .width = el .clientWidth ;
135- if ( ! this . options . toImageButtonOptions .height ) this . options . toImageButtonOptions .height = el .clientHeight ;
136- return Plotly .newPlot (this .$refs .container , this .data , this .internalLayout , this . options )
132+ // if width/height is not specified for toImageButton, default to el.clientWidth/clientHeight
133+ if ( ! opts) opts = {}
134+ if ( ! opts . toImageButtonOptions ) opts . toImageButtonOptions = {}
135+ if ( ! opts . toImageButtonOptions .width ) opts . toImageButtonOptions .width = el .clientWidth
136+ if ( ! opts . toImageButtonOptions .height ) opts . toImageButtonOptions .height = el .clientHeight
137+ return Plotly .newPlot (this .$refs .container , this .data , this .internalLayout , opts )
137138 },
138139 react () {
139140 return Plotly .react (this .$refs .container , this .data , this .internalLayout , this .options )
0 commit comments