Skip to content

Commit 172d81d

Browse files
committed
autosize: restore backwards-compatibility with v1
* Initialise `layout.width` and `layout.height` if `autosize` is false.
1 parent 862578e commit 172d81d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/plots/plots.js

+6
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,12 @@ plots.supplyDefaults = function(gd) {
497497
autosizable = gd._context && gd._context.autosizable,
498498
initialAutoSize = missingWidthOrHeight && (autosize || autosizable);
499499
if(initialAutoSize) plots.plotAutoSize(gd, newLayout, newFullLayout);
500+
501+
// for backwards-compatibility with Plotly v1.x.x
502+
if(!autosize && missingWidthOrHeight) {
503+
newLayout.width = newFullLayout.width;
504+
newLayout.height = newFullLayout.height;
505+
}
500506
}
501507

502508
newFullLayout._initialAutoSizeIsDone = true;

0 commit comments

Comments
 (0)