@@ -1366,18 +1366,9 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {
1366
1366
document . body . style . overflow = 'hidden' ;
1367
1367
}
1368
1368
else if ( isNumeric ( frameMargins ) && frameMargins > 0 ) {
1369
- var reservedMargins = calculateReservedMargins ( gd . _boundingBoxMargins ) ,
1370
- reservedWidth = reservedMargins . left + reservedMargins . right ,
1371
- reservedHeight = reservedMargins . bottom + reservedMargins . top ,
1372
- factor = 1 - 2 * frameMargins ;
1373
-
1374
- var gdBB = {
1375
- width : fullLayout . width ,
1376
- height : fullLayout . height
1377
- } ;
1378
-
1379
- newWidth = Math . round ( factor * ( gdBB . width - reservedWidth ) ) ;
1380
- newHeight = Math . round ( factor * ( gdBB . height - reservedHeight ) ) ;
1369
+ var factor = 1 - 2 * frameMargins ;
1370
+ newWidth = Math . round ( factor * fullLayout . width ) ;
1371
+ newHeight = Math . round ( factor * fullLayout . height ) ;
1381
1372
}
1382
1373
else {
1383
1374
// plotly.js - let the developers do what they want, either
@@ -1414,29 +1405,6 @@ plots.plotAutoSize = function plotAutoSize(gd, layout, fullLayout) {
1414
1405
plots . sanitizeMargins ( fullLayout ) ;
1415
1406
} ;
1416
1407
1417
- /**
1418
- * Reduce all reserved margin objects to a single required margin reservation.
1419
- *
1420
- * @param {Object } margins
1421
- * @returns {{left: number, right: number, bottom: number, top: number} }
1422
- */
1423
- function calculateReservedMargins ( margins ) {
1424
- var resultingMargin = { left : 0 , right : 0 , bottom : 0 , top : 0 } ,
1425
- marginName ;
1426
-
1427
- if ( margins ) {
1428
- for ( marginName in margins ) {
1429
- if ( margins . hasOwnProperty ( marginName ) ) {
1430
- resultingMargin . left += margins [ marginName ] . left || 0 ;
1431
- resultingMargin . right += margins [ marginName ] . right || 0 ;
1432
- resultingMargin . bottom += margins [ marginName ] . bottom || 0 ;
1433
- resultingMargin . top += margins [ marginName ] . top || 0 ;
1434
- }
1435
- }
1436
- }
1437
- return resultingMargin ;
1438
- }
1439
-
1440
1408
plots . supplyLayoutModuleDefaults = function ( layoutIn , layoutOut , fullData , transitionData ) {
1441
1409
var componentsRegistry = Registry . componentsRegistry ;
1442
1410
var basePlotModules = layoutOut . _basePlotModules ;
0 commit comments