Skip to content

Commit

Permalink
add zeroline visibility test for overlaying subplots
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcjohnson committed Aug 22, 2018
1 parent 545ad47 commit bcd7c06
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion test/jasmine/tests/axes_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2849,7 +2849,7 @@ describe('Test axes', function() {
.then(done);
});

it('works with multiple subplots', function(done) {
it('works with multiple coupled subplots', function(done) {
Plotly.newPlot(gd, [
{x: [1, 2, 3], y: [1, 2, 3]},
{x: [1, 2, 3], y: [1, 2, 3], xaxis: 'x2'},
Expand Down Expand Up @@ -2883,6 +2883,47 @@ describe('Test axes', function() {
.catch(failTest)
.then(done);
});

it('works with multiple overlaid subplots', function(done) {
Plotly.newPlot(gd, [
{x: [1, 2, 3], y: [1, 2, 3]},
{x: [1, 2, 3], y: [1, 2, 3], xaxis: 'x2', yaxis: 'y2'}
], {
xaxis: {range: [0, 4], showzeroline: true},
yaxis: {range: [0, 4], showzeroline: true},
xaxis2: {range: [0, 4], showzeroline: true, side: 'top', overlaying: 'x'},
yaxis2: {range: [0, 4], showzeroline: true, side: 'right', overlaying: 'y'},
width: 600,
height: 600
})
.then(function() {
assertZeroLines(['x', 'y', 'x2', 'y2']);
return Plotly.relayout(gd, {'xaxis.showline': true, 'yaxis.showline': true});
})
.then(function() {
assertZeroLines([]);
return Plotly.relayout(gd, {
'xaxis.range': [4, 0],
'yaxis.range': [4, 0],
'xaxis2.range': [4, 0],
'yaxis2.range': [4, 0]
});
})
.then(function() {
assertZeroLines(['x', 'y', 'x2', 'y2']);
return Plotly.relayout(gd, {
'xaxis.showline': false,
'yaxis.showline': false,
'xaxis2.showline': true,
'yaxis2.showline': true
});
})
.then(function() {
assertZeroLines([]);
})
.catch(failTest)
.then(done);
});
});
});

Expand Down

0 comments on commit bcd7c06

Please sign in to comment.