File tree 1 file changed +7
-3
lines changed
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) {
1821
1821
// op and has no flag.
1822
1822
undoit [ ai ] = ( pleaf === 'reverse' ) ? vi : p . get ( ) ;
1823
1823
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.
1826
1830
if ( [ 'width' , 'height' ] . indexOf ( ai ) !== - 1 && vi === null ) {
1827
- vi = 'initial' ;
1831
+ gd . _fullLayout [ ai ] = Plots . layoutAttributes [ ai ] . dflt ;
1828
1832
}
1829
1833
// check autorange vs range
1830
1834
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