From 8278a7c2b7aeb8e293734e7e7f2a0baeb6f0ba76 Mon Sep 17 00:00:00 2001 From: archmoj Date: Sun, 28 Oct 2018 18:42:48 -0400 Subject: [PATCH 1/5] fix for issue 1976 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f67193c84df..23518764742 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": "git://github.com/gl-vis/gl-line3d.git#50202331742946769647be7c77cf6c53b019d205", "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.1", "gl-plot2d": "^1.3.1", From 54bb05bc463a62eec71727e66b93dcb300f60579 Mon Sep 17 00:00:00 2001 From: archmoj Date: Sun, 28 Oct 2018 19:43:10 -0400 Subject: [PATCH 2/5] fix for issue 1976 with improved condition checks for input arrays --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 23518764742..bfbcd0c8ec3 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": "git://github.com/gl-vis/gl-line3d.git#50202331742946769647be7c77cf6c53b019d205", + "gl-line3d": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.1", "gl-plot2d": "^1.3.1", From 2f7d8fe9c07efee709b5987fc17b77ec339c536d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 29 Oct 2018 14:13:22 -0400 Subject: [PATCH 3/5] fixup package-lock --- package-lock.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index fc485517331..3c8251e04ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4642,9 +4642,8 @@ } }, "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": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", + "from": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", "requires": { "binary-search-bounds": "^1.0.0", "gl-buffer": "^2.0.8", From afac92b078d2dbb7c668edb2f871b5514b05b0d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 29 Oct 2018 14:24:34 -0400 Subject: [PATCH 4/5] add test, making sure we don't call vao.draw when vertexCount===0 --- test/jasmine/tests/gl3d_plot_interact_test.js | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) 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() { From b0e1c1bf73b1862dc29c0179bb47852510ce1628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89tienne=20T=C3=A9treault-Pinard?= Date: Mon, 29 Oct 2018 14:47:22 -0400 Subject: [PATCH 5/5] use gl-line3d@1.1.5 --- package-lock.json | 5 +++-- package.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 337b17a833a..895e44c8501 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4645,8 +4645,9 @@ } }, "gl-line3d": { - "version": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", - "from": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", + "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 8f508d9070b..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": "git://github.com/gl-vis/gl-line3d.git#860955328a385e0bdbd6d8b1d72b0a0ca433e6c7", + "gl-line3d": "^1.1.5", "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.1", "gl-plot2d": "^1.3.1",