8000 Range slider fixes (user set y axis types + trace clearance) by etpinard · Pull Request #1472 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Range slider fixes (user set y axis types + trace clearance) #1472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
lint range slider visibility suite
  • Loading branch information
etpinard committed Mar 14, 2017
commit cb0202c8d226b0a2a038737be910b5e123f426a4
65 changes: 39 additions & 26 deletions test/jasmine/tests/range_slider_test.js
8453
Original file line number Diff line number Diff line change
Expand Up @@ -294,43 +294,56 @@ describe('the range slider', function() {

it('should not add the slider to the DOM by default', function(done) {
Plotly.plot(gd, [{ x: [1, 2, 3], y: [2, 3, 4] }], {})
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).not.toBeDefined();
})
.then(done);
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).not.toBeDefined();
})
.then(done);
});

it('should add the slider if rangeslider is set to anything', function(done) {
Plotly.plot(gd, [{ x: [1, 2, 3], y: [2, 3, 4] }], {})
.then(function() { Plotly.relayout(gd, 'xaxis.rangeslider', 'exists'); })
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).toBeDefined();
})
.then(done);
.then(function() {
return Plotly.relayout(gd, 'xaxis.rangeslider', 'exists');
})
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).toBeDefined();
})
.then(done);
});

it('should add the slider if visible changed to `true`', function(done) {
Plotly.plot(gd, [{ x: [1, 2, 3], y: [2, 3, 4] }], {})
.then(function() { Plotly.relayout(gd, 'xaxis.rangeslider.visible', true); })
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).toBeDefined();
expect(countRangeSliderClipPaths()).toEqual(1);
})
.then(done);
.then(function() {
return Plotly.relayout(gd, 'xaxis.rangeslider.visible', true);
})
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).toBeDefined();
expect(countRangeSliderClipPaths()).toEqual(1);
})
.then(done);
});

it('should remove the slider if changed to `false` or `undefined`', function(done) {
Plotly.plot(gd, [{ x: [1, 2, 3], y: [2, 3, 4] }], { xaxis: { rangeslider: { visible: true }}})
.then(function() { Plotly.relayout(gd, 'xaxis.rangeslider.visible', false); })
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).not.toBeDefined();
expect(countRangeSliderClipPaths()).toEqual(0);
})
.then(done);
Plotly.plot(gd, [{
x: [1, 2, 3],
y: [2, 3, 4]
}], {
xaxis: {
rangeslider: { visible: true }
}
})
.then(function() {
return Plotly.relayout(gd, 'xaxis.rangeslider.visible', false);
})
.then(function() {
var rangeSlider = getRangeSlider();
expect(rangeSlider).not.toBeDefined();
expect(countRangeSliderClipPaths()).toEqual(0);
})
.then(done);
});
});

Expand Down
0