Skip to content

gl2d non-visible traces improvements #1300

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 4 commits into from
Jan 18, 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 gl2d visible toggle jasmine test
  • Loading branch information
etpinard committed Jan 17, 2017
commit a587f8d31246c0a01e8451e889728968a25f87ba
33 changes: 33 additions & 0 deletions test/jasmine/tests/gl_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,39 @@ describe('Test gl plot interactions', function() {

}, MODEBAR_DELAY);
});

it('should be able to toggle visibility', function(done) {
var OBJECT_PER_TRACE = 5;

var objects = function() {
return gd._fullLayout._plots.xy._scene2d.glplot.objects;
};

expect(objects().length).toEqual(OBJECT_PER_TRACE);

Plotly.restyle(gd, 'visible', 'legendonly').then(function() {
expect(objects().length).toEqual(OBJECT_PER_TRACE);
expect(objects()[0].data.length).toEqual(0);

return Plotly.restyle(gd, 'visible', true);
})
.then(function() {
expect(objects().length).toEqual(OBJECT_PER_TRACE);
expect(objects()[0].data.length).not.toEqual(0);

return Plotly.restyle(gd, 'visible', false);
})
.then(function() {
expect(gd._fullLayout._plots.xy._scene2d).toBeUndefined();

return Plotly.restyle(gd, 'visible', true);
})
.then(function() {
expect(objects().length).toEqual(OBJECT_PER_TRACE);
expect(objects()[0].data.length).not.toEqual(0);
})
.then(done);
});
});

describe('gl3d event handlers', function() {
Expand Down