Skip to content

Commit 16ea22a

Browse files
committed
reduce automargin padding for small explicit margins
1 parent 5d31324 commit 16ea22a

File tree

10 files changed

+7
-1
lines changed

10 files changed

+7
-1
lines changed

src/plots/plots.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,13 @@ plots.autoMargin = function(gd, id, o) {
16321632
delete pushMarginIds[id];
16331633
}
16341634
else {
1635-
var pad = o.pad === undefined ? 12 : o.pad;
1635+
var pad = o.pad;
1636+
if(pad === undefined) {
1637+
var margin = fullLayout.margin;
1638+
// if no explicit pad is given, use 12px unless there's a
1639+
// specified margin that's smaller than that
1640+
pad = Math.min(12, margin.l, margin.r, margin.t, margin.b);
1641+
}
16361642

16371643
// if the item is too big, just give it enough automargin to
16381644
// make sure you can still grab it and bring it back

test/image/baselines/11.png

86 Bytes
Loading

test/image/baselines/15.png

-1.04 KB
Loading

test/image/baselines/28.png

196 Bytes
Loading

test/image/baselines/5.png

-1.22 KB
Loading

test/image/baselines/benchmarks.png

-582 Bytes
Loading

test/image/baselines/dendrogram.png

-88 Bytes
Loading
810 Bytes
Loading
-602 Bytes
Loading
Loading

0 commit comments

Comments
 (0)