Skip to content

Refactor scattergl selection #2311

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 9 commits into from
Feb 2, 2018
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
27 changes: 26 additions & 1 deletion test/jasmine/tests/gl2d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var Plotly = require('@lib/index');
var Plots = require('@src/plots/plots');
var Lib = require('@src/lib');
var Drawing = require('@src/components/drawing');
var ScatterGl = require('@src/traces/scattergl');

var createGraphDiv = require('../assets/create_graph_div');
var destroyGraphDiv = require('../assets/destroy_graph_div');
Expand All @@ -14,6 +15,7 @@ var selectButton = require('../assets/modebar_button');
var delay = require('../assets/delay');
var readPixel = require('../assets/read_pixel');


function countCanvases() {
return d3.selectAll('canvas').size();
}
Expand Down Expand Up @@ -406,7 +408,6 @@ describe('Test gl2d plots', function() {
.then(done);
});


it('@noCI should display selection of big number of miscellaneous points', function(done) {
var colorList = [
'#006385', '#F06E75', '#90ed7d', '#f7a35c', '#8085e9',
Expand Down Expand Up @@ -645,4 +646,28 @@ describe('Test gl2d plots', function() {
.catch(fail)
.then(done);
});

it('should restyle opacity', function(done) {
// #2299
spyOn(ScatterGl, 'calc');

var dat = [{
'x': [1, 2, 3],
'y': [1, 2, 3],
'type': 'scattergl',
'mode': 'markers'
}];

Plotly.plot(gd, dat, {width: 500, height: 500})
.then(function() {
expect(ScatterGl.calc).toHaveBeenCalledTimes(1);

return Plotly.restyle(gd, {'opacity': 0.1});
})
.then(function() {
expect(ScatterGl.calc).toHaveBeenCalledTimes(2);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brilliant test ✨

})
.catch(fail)
.then(done);
});
});