Skip to content

Draw updatemenus over sliders #1302

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 2 commits into from
Jan 16, 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
add test checking that updatemenus are above sliders
  • Loading branch information
etpinard committed Jan 16, 2017
commit f2db0d797a0149c9f452df0f9c72104e14449adc
68 changes: 67 additions & 1 deletion test/jasmine/tests/updatemenus_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ describe('update menus interactions', function() {
}).catch(fail).then(done);
});

it('appliesy padding on relayout', function(done) {
it('applies y padding on relayout', function(done) {
var x1, x2;
var firstMenu = d3.select('.' + constants.headerGroupClassName);
var padShift = 40;
Expand Down Expand Up @@ -734,3 +734,69 @@ describe('update menus interactions', function() {
return button;
}
});


describe('update menus interaction with other components:', function() {
'use strict';

afterEach(destroyGraphDiv);

it('buttons show be drawn above sliders', function(done) {

Plotly.plot(createGraphDiv(), [{
x: [1, 2, 3],
y: [1, 2, 1]
}], {
sliders: [{
xanchor: 'right',
x: -0.05,
y: 0.9,
len: 0.3,
steps: [{
label: 'red',
method: 'restyle',
args: [{'line.color': 'red'}]
}, {
label: 'orange',
method: 'restyle',
args: [{'line.color': 'orange'}]
}, {
label: 'yellow',
method: 'restyle',
args: [{'line.color': 'yellow'}]
}]
}],
updatemenus: [{
buttons: [{
label: 'markers and lines',
method: 'restyle',
args: [{ 'mode': 'markers+lines' }]
}, {
label: 'markers',
method: 'restyle',
args: [{ 'mode': 'markers' }]
}, {
label: 'lines',
method: 'restyle',
args: [{ 'mode': 'lines' }]
}]
}]
})
.then(function() {
var infoLayer = d3.select('g.infolayer');
var containerClassNames = ['slider-container', 'updatemenu-container'];
var list = [];

infoLayer.selectAll('*').each(function() {
var className = d3.select(this).attr('class');

if(containerClassNames.indexOf(className) !== -1) {
list.push(className);
}
});

expect(list).toEqual(containerClassNames);
})
.then(done);
});
});