Skip to content

Fix for issue 1976 - remove webgl warnings for empty lines when using gl-line3d #3174

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 6 commits into from
Oct 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"gl-contour2d": "^1.1.4",
"gl-error3d": "^1.0.8",
"gl-heatmap2d": "^1.0.4",
"gl-line3d": "^1.1.4",
"gl-line3d": "^1.1.5",
"gl-mat4": "^1.2.0",
"gl-mesh3d": "^2.0.1",
"gl-plot2d": "^1.3.1",
Expand Down
27 changes: 27 additions & 0 deletions test/jasmine/tests/gl3d_plot_interact_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,33 @@ describe('Test gl3d plots', function() {
.then(done);
});

it('@gl should avoid passing empty lines to webgl', function(done) {
var obj;

Plotly.plot(gd, [{
type: 'scatter3d',
mode: 'lines',
x: [1],
y: [2],
z: [3]
}])
.then(function() {
obj = gd._fullLayout.scene._scene.glplot.objects[0];
spyOn(obj.vao, 'draw').and.callThrough();

expect(obj.vertexCount).toBe(0, '# of vertices');

return Plotly.restyle(gd, 'line.color', 'red');
})
.then(function() {
expect(obj.vertexCount).toBe(0, '# of vertices');
// calling this with no vertex causes WebGL warnings,
// see https://github.com/plotly/plotly.js/issues/1976
expect(obj.vao.draw).toHaveBeenCalledTimes(0);
})
.catch(failTest)
.then(done);
});
});

describe('Test gl3d modebar handlers', function() {
Expand Down