File tree 2 files changed +10
-1
lines changed
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) {
1803
1803
// op and has no flag.
1804
1804
undoit [ ai ] = ( pleaf === 'reverse' ) ? vi : p . get ( ) ;
1805
1805
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
+ }
1806
1811
// 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 ] \] ) ? $ / ) ) {
1808
1813
doextra ( ptrunk + '.autorange' , false ) ;
1809
1814
}
1810
1815
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) {
307
307
} ) ;
308
308
}
309
309
}
310
+
310
311
plots . sendDataToCloud = function ( gd ) {
311
312
gd . emit ( 'plotly_beforeexport' ) ;
312
313
@@ -372,6 +373,7 @@ plots.supplyDefaults = function(gd) {
372
373
// because fullData needs a few things from layout
373
374
374
375
if ( oldFullLayout . _initialAutoSizeIsDone ) {
376
+
375
377
// coerce the updated layout while preserving width and height
376
378
var oldWidth = oldFullLayout . width ,
377
379
oldHeight = oldFullLayout . height ;
@@ -382,13 +384,15 @@ plots.supplyDefaults = function(gd) {
382
384
if ( ! newLayout . height ) newFullLayout . height = oldHeight ;
383
385
}
384
386
else {
387
+
385
388
// coerce the updated layout and autosize if needed
386
389
plots . supplyLayoutGlobalDefaults ( newLayout , newFullLayout ) ;
387
390
388
391
var missingWidthOrHeight = ( ! newLayout . width || ! newLayout . height ) ,
389
392
autosize = newFullLayout . autosize ,
390
393
autosizable = gd . _context && gd . _context . autosizable ,
391
394
initialAutoSize = missingWidthOrHeight && ( autosize || autosizable ) ;
395
+
392
396
if ( initialAutoSize ) plots . plotAutoSize ( gd , newLayout , newFullLayout ) ;
393
397
else if ( missingWidthOrHeight ) plots . sanitizeMargins ( gd ) ;
394
398
You can’t perform that action at this time.
0 commit comments