Skip to content

Commit 0702b78

Browse files
added IE11 compatibility
1 parent 0ed3602 commit 0702b78

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

src/plots/cartesian/axes.js

+13-9
Original file line numberDiff line numberDiff line change
@@ -2643,25 +2643,29 @@ function keepSelectedAutoMargin(automargin, push) {
26432643

26442644
var keepMargin = [];
26452645
var mapping = {
2646-
width: ['x', 'r', 'l'],
2647-
height: ['y', 't', 'b'],
2648-
right: ['r'],
2649-
left: ['l'],
2650-
top: ['t'],
2651-
bottom: ['b']
2646+
width: ['x', 'r', 'l', 'xl', 'xr'],
2647+
height: ['y', 't', 'b', 'yt', 'yb'],
2648+
right: ['r', 'xr'],
2649+
left: ['l', 'xl'],
2650+
top: ['t', 'yt'],
2651+
bottom: ['b', 'yb']
26522652
};
26532653

26542654
Object.keys(mapping).forEach(function(key) {
2655-
if(automargin.includes(key)) {
2655+
if(automargin.indexOf(key) !== -1) {
26562656
mapping[key].forEach(function(item) {
26572657
keepMargin.push(item);
26582658
});
26592659
}
26602660
});
26612661

26622662
Object.keys(push).forEach(function(key) {
2663-
if(key.length !== 2 && !keepMargin.includes(key)) {
2664-
push[key] = 0;
2663+
if(keepMargin.indexOf(key) === -1) {
2664+
if(key.length === 1) {
2665+
push[key] = 0;
2666+
} else {
2667+
delete push[key];
2668+
}
26652669
}
26662670
});
26672671
return push;

0 commit comments

Comments
 (0)