Skip to content

Commit 24aeb7c

Browse files
committed
axRange edits don't need drawMarginPushers after all
must have been necessary mid-development then fixed later on?
1 parent 16ea22a commit 24aeb7c

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

src/plot_api/plot_api.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1732,8 +1732,7 @@ function addAxRangeSequence(seq, rangesAltered) {
17321732
seq.push(
17331733
doTicks,
17341734
subroutines.drawData,
1735-
subroutines.finalDraw,
1736-
subroutines.drawMarginPushers
1735+
subroutines.finalDraw
17371736
);
17381737
}
17391738

test/jasmine/tests/axes_test.js

+34
Original file line numberDiff line numberDiff line change
@@ -2655,6 +2655,40 @@ describe('Test axes', function() {
26552655

26562656
previousSize = Lib.extendDeep({}, size);
26572657
savedBottom = previousSize.b;
2658+
2659+
// move all the long x labels off-screen
2660+
return Plotly.relayout(gd, {'xaxis.range': [-10, -5]});
2661+
})
2662+
.then(function() {
2663+
var size = gd._fullLayout._size;
2664+
expect(size.l).toBe(previousSize.l);
2665+
expect(size.r).toBe(previousSize.r);
2666+
expect(size.t).toBe(previousSize.t);
2667+
expect(size.b).toBe(initialSize.b);
2668+
2669+
// move all the long y labels off-screen
2670+
return Plotly.relayout(gd, {'yaxis.range': [-10, -5]});
2671+
})
2672+
.then(function() {
2673+
var size = gd._fullLayout._size;
2674+
expect(size.l).toBe(initialSize.l);
2675+
expect(size.r).toBe(previousSize.r);
2676+
expect(size.t).toBe(previousSize.t);
2677+
expect(size.b).toBe(initialSize.b);
2678+
2679+
// bring the long labels back
2680+
return Plotly.relayout(gd, {
2681+
'xaxis.autorange': true,
2682+
'yaxis.autorange': true
2683+
});
2684+
})
2685+
.then(function() {
2686+
var size = gd._fullLayout._size;
2687+
expect(size.l).toBe(previousSize.l);
2688+
expect(size.r).toBe(previousSize.r);
2689+
expect(size.t).toBe(previousSize.t);
2690+
expect(size.b).toBe(previousSize.b);
2691+
26582692
return Plotly.relayout(gd, {'xaxis.tickangle': 45});
26592693
})
26602694
.then(function() {

test/jasmine/tests/plot_api_test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ describe('Test plot api', function() {
632632
});
633633

634634
it('should trigger minimal sequence for cartesian axis range updates', function() {
635-
var seq = ['doTicksRelayout', 'drawData', 'finalDraw', 'drawMarginPushers'];
635+
var seq = ['doTicksRelayout', 'drawData', 'finalDraw'];
636636

637637
function _assert(msg) {
638638
expect(gd.calcdata).toBeDefined();

0 commit comments

Comments
 (0)