diff --git a/package-lock.json b/package-lock.json index 059e18e6e93..895e44c8501 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4645,9 +4645,9 @@ } }, "gl-line3d": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/gl-line3d/-/gl-line3d-1.1.4.tgz", - "integrity": "sha512-XwwjPP3qaAan7emC1gW4yEYU7nag77snhhK8i+hOgRSDl+rfxhi7s0EFSiO+WY321mMvLEiLwiKKonkMRCsYvQ==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/gl-line3d/-/gl-line3d-1.1.5.tgz", + "integrity": "sha512-l0M/prZfiUtG1jh+1TsJw3H0DbifSU4Wqeni6o0iFwwLuz/FL/IbWbYY6LufV3jWHMt7Oc7Nj/YwiK+m4vBPgg==", "requires": { "binary-search-bounds": "^1.0.0", "gl-buffer": "^2.0.8", diff --git a/package.json b/package.json index d6a23056ffc..a2d9bd06f7a 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 52e79ce0bd3..7cdb1e36e7f 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -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() {