File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1821,10 +1821,14 @@ function _relayout(gd, aobj) {
18211821 // op and has no flag.
18221822 undoit [ ai ] = ( pleaf === 'reverse' ) ? vi : p . get ( ) ;
18231823
1824- // tweak width / height update value when null such that
1825- // new dimensions are honored in Plots.supplyDefaults
1824+ // Setting width or height to null must reset the graph's width / height
1825+ // back to its initial value as listed in attribute declaration.
1826+ //
1827+ // We must manually set them back here, because we can't rely on
1828+ // Plots.plotAutoSize as it falls back to computing width / height values
1829+ // from the DOM which can have been changed by other relayout calls.
18261830 if ( [ 'width' , 'height' ] . indexOf ( ai ) !== - 1 && vi === null ) {
1827- vi = 'initial' ;
1831+ gd . _fullLayout [ ai ] = Plots . layoutAttributes [ ai ] . dflt ;
18281832 }
18291833 // check autorange vs range
18301834 else if ( pleafPlus . match ( / ^ [ x y z ] a x i s [ 0 - 9 ] * \. r a n g e ( \[ [ 0 | 1 ] \] ) ? $ / ) ) {
You can’t perform that action at this time.
0 commit comments