File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1803,8 +1803,13 @@ function _relayout(gd, aobj) {
18031803 // op and has no flag.
18041804 undoit [ ai ] = ( pleaf === 'reverse' ) ? vi : p . get ( ) ;
18051805
1806+ // tweak width / height update value when null such that
1807+ // new dimensions are honored in Plots.supplyDefaults
1808+ if ( [ 'width' , 'height' ] . indexOf ( ai ) !== - 1 && vi === null ) {
1809+ vi = 'initial' ;
1810+ }
18061811 // check autorange vs range
1807- if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. r a n g e ( \[ [ 0 | 1 ] \] ) ? $ / ) ) {
1812+ else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. r a n g e ( \[ [ 0 | 1 ] \] ) ? $ / ) ) {
18081813 doextra ( ptrunk + '.autorange' , false ) ;
18091814 }
18101815 else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. a u t o r a n g e $ / ) ) {
Original file line number Diff line number Diff line change @@ -307,6 +307,7 @@ function positionPlayWithData(gd, container) {
307307 } ) ;
308308 }
309309}
310+
310311plots . sendDataToCloud = function ( gd ) {
311312 gd . emit ( 'plotly_beforeexport' ) ;
312313
@@ -372,6 +373,7 @@ plots.supplyDefaults = function(gd) {
372373 // because fullData needs a few things from layout
373374
374375 if ( oldFullLayout . _initialAutoSizeIsDone ) {
376+
375377 // coerce the updated layout while preserving width and height
376378 var oldWidth = oldFullLayout . width ,
377379 oldHeight = oldFullLayout . height ;
@@ -382,13 +384,15 @@ plots.supplyDefaults = function(gd) {
382384 if ( ! newLayout . height ) newFullLayout . height = oldHeight ;
383385 }
384386 else {
387+
385388 // coerce the updated layout and autosize if needed
386389 plots . supplyLayoutGlobalDefaults ( newLayout , newFullLayout ) ;
387390
388391 var missingWidthOrHeight = ( ! newLayout . width || ! newLayout . height ) ,
389392 autosize = newFullLayout . autosize ,
390393 autosizable = gd . _context && gd . _context . autosizable ,
391394 initialAutoSize = missingWidthOrHeight && ( autosize || autosizable ) ;
395+
392396 if ( initialAutoSize ) plots . plotAutoSize ( gd , newLayout , newFullLayout ) ;
393397 else if ( missingWidthOrHeight ) plots . sanitizeMargins ( gd ) ;
394398
You can’t perform that action at this time.
0 commit comments