From 54b1ca18ca12162098d125015d251ee9e5245d1b Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 26 Feb 2019 21:36:14 -0500 Subject: [PATCH 01/13] fix issue 3576 disable camera mouse listener before scene is complete --- src/plots/gl3d/scene.js | 3 + test/jasmine/tests/gl3d_plot_interact_test.js | 68 +++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index d7cc4bff620..8fec8835845 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -372,6 +372,9 @@ proto.initializeGLCamera = function() { zoomMax: 100, mode: 'orbit' }); + + // Note: we shoule disable camera interactions until the scene is complete + this.camera.mouseListener.enabled = false; }; proto.recoverContext = function() { diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index dbed484ca3c..f6a25c945eb 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -75,6 +75,74 @@ describe('Test gl3d plots', function() { destroyGraphDiv(); }); + it('@gl should not rotate camera on the very first click before scene is complete and modebar setup', function(done) { + var _mock = Lib.extendDeep( + { + layout: { + scene: { + camera: { + up: { + x: 0, + y: 0, + z: 1 + }, + eye: { + x: 1.2, + y: 1.2, + z: 1.2 + }, + center: { + x: 0, + y: 0, + z: 0 + } + } + } + } + }, + mock2 + ); + + // N.B. gl3d click events are 'mouseover' events + // with button 1 pressed + function _click() { + mouseEvent('mouseover', 605, 271, {buttons: 1}); + return delay(20)(); + } + + Plotly.plot(gd, _mock) + .then(delay(20)) + .then(function() { + gd.on('plotly_click', function(eventData) { + ptData = eventData.points[0]; + }); + }) + .then(_click) + .then(delay(20)) + .then(function() { + expect(gd._fullLayout.scene.camera.up.x).toEqual(0, 'camera.up.x'); + expect(gd._fullLayout.scene.camera.up.y).toEqual(0, 'camera.up.y'); + expect(gd._fullLayout.scene.camera.up.z).toEqual(1, 'camera.up.z'); + expect(gd._fullLayout.scene.camera.eye.x).toEqual(1.2, 'camera.eye.x'); + expect(gd._fullLayout.scene.camera.eye.y).toEqual(1.2, 'camera.eye.y'); + expect(gd._fullLayout.scene.camera.eye.z).toEqual(1.2, 'camera.eye.z'); + expect(gd._fullLayout.scene.camera.center.x).toEqual(0, 'camera.center.x'); + expect(gd._fullLayout.scene.camera.center.y).toEqual(0, 'camera.center.y'); + expect(gd._fullLayout.scene.camera.center.z).toEqual(0, 'camera.center.z'); + + expect(gd._fullLayout.scene._scene.glplot.camera.up[0]).toEqual(0, 'camera.up[0]'); + expect(gd._fullLayout.scene._scene.glplot.camera.up[1]).toEqual(0, 'camera.up[1]'); + expect(gd._fullLayout.scene._scene.glplot.camera.up[2]).toEqual(1, 'camera.up[2]'); + expect(gd._fullLayout.scene._scene.glplot.camera.eye[0]).toBeCloseTo(1.2, 6, 'camera.eye[0]'); + expect(gd._fullLayout.scene._scene.glplot.camera.eye[1]).toBeCloseTo(1.2, 6, 'camera.eye[1]'); + expect(gd._fullLayout.scene._scene.glplot.camera.eye[2]).toBeCloseTo(1.2, 6, 'camera.eye[2]'); + expect(gd._fullLayout.scene._scene.glplot.camera.center[0]).toEqual(0, 'camera.center[0]'); + expect(gd._fullLayout.scene._scene.glplot.camera.center[1]).toEqual(0, 'camera.center[1]'); + expect(gd._fullLayout.scene._scene.glplot.camera.center[2]).toEqual(0, 'camera.center[2]'); + }) + .then(done); + }); + it('@noCI @gl should display correct hover labels of the second point of the very first scatter3d trace', function(done) { var _mock = Lib.extendDeep({}, multipleScatter3dMock); From bb252af33f8f66733eca77054fdb60598e588b9b Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 10:16:27 -0500 Subject: [PATCH 02/13] enable mouse listener when the scene is complete and improved jasmine test - also avoid return in updateFx to ensure dragmode and hovermode stay on the same ground --- src/plots/gl3d/scene.js | 24 ++++---- test/jasmine/tests/gl3d_plot_interact_test.js | 60 +++++++++++-------- 2 files changed, 49 insertions(+), 35 deletions(-) diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index 8fec8835845..478a4eebe17 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -354,6 +354,9 @@ function Scene(options, fullLayout) { var camera = fullLayout.scene.camera; initializeGLPlot(this, camera, this.pixelRatio); + + // enable mouse listener which was disabled at camera init + this.camera.mouseListener.enabled = true; } var proto = Scene.prototype; @@ -854,7 +857,6 @@ proto.saveCamera = function saveCamera(layout) { proto.updateFx = function(dragmode, hovermode) { var camera = this.camera; - if(camera) { // rotate and orbital are synonymous if(dragmode === 'orbit') { @@ -876,16 +878,16 @@ proto.updateFx = function(dragmode, hovermode) { var y = fullCamera.up.y; var z = fullCamera.up.z; // only push `up` back to (full)layout if it's going to change - if(z / Math.sqrt(x * x + y * y + z * z) > 0.999) return; - - var attr = this.id + '.camera.up'; - var zUp = {x: 0, y: 0, z: 1}; - var edits = {}; - edits[attr] = zUp; - var layout = gd.layout; - Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, edits); - fullCamera.up = zUp; - Lib.nestedProperty(layout, attr).set(zUp); + if(z / Math.sqrt(x * x + y * y + z * z) < 0.999) { + var attr = this.id + '.camera.up'; + var zUp = {x: 0, y: 0, z: 1}; + var edits = {}; + edits[attr] = zUp; + var layout = gd.layout; + Registry.call('_storeDirectGUIEdit', layout, fullLayout._preGUI, edits); + fullCamera.up = zUp; + Lib.nestedProperty(layout, attr).set(zUp); + } } else { // none rotation modes [pan or zoom] camera.keyBindingMode = dragmode; diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index f6a25c945eb..55c3e14371f 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -75,7 +75,7 @@ describe('Test gl3d plots', function() { destroyGraphDiv(); }); - it('@gl should not rotate camera on the very first click before scene is complete and modebar setup', function(done) { + it('@gl should not rotate camera on the very first click before scene is complete and then should rotate', function(done) { var _mock = Lib.extendDeep( { layout: { @@ -117,28 +117,43 @@ describe('Test gl3d plots', function() { ptData = eventData.points[0]; }); }) + .then(delay(20)) + .then(function() { + var cameraIn = gd._fullLayout.scene.camera; + expect(cameraIn.up.x).toEqual(0, 'cameraIn.up.x'); + expect(cameraIn.up.y).toEqual(0, 'cameraIn.up.y'); + expect(cameraIn.up.z).toEqual(1, 'cameraIn.up.z'); + expect(cameraIn.center.x).toEqual(0, 'cameraIn.center.x'); + expect(cameraIn.center.y).toEqual(0, 'cameraIn.center.y'); + expect(cameraIn.center.z).toEqual(0, 'cameraIn.center.z'); + expect(cameraIn.eye.x).toEqual(1.2, 'cameraIn.eye.x'); + expect(cameraIn.eye.y).toEqual(1.2, 'cameraIn.eye.y'); + expect(cameraIn.eye.z).toEqual(1.2, 'cameraIn.eye.z'); + + var cameraBefore = gd._fullLayout.scene._scene.glplot.camera; + expect(cameraBefore.up[0]).toBeCloseTo(0, 3, 'cameraBefore.up[0]'); + expect(cameraBefore.up[1]).toBeCloseTo(0, 3, 'cameraBefore.up[1]'); + expect(cameraBefore.up[2]).toBeCloseTo(1, 3, 'cameraBefore.up[2]'); + expect(cameraBefore.center[0]).toBeCloseTo(0, 3, 'cameraBefore.center[0]'); + expect(cameraBefore.center[1]).toBeCloseTo(0, 3, 'cameraBefore.center[1]'); + expect(cameraBefore.center[2]).toBeCloseTo(0, 3, 'cameraBefore.center[2]'); + expect(cameraBefore.eye[0]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[0]'); + expect(cameraBefore.eye[1]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[1]'); + expect(cameraBefore.eye[2]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[2]'); + }) .then(_click) .then(delay(20)) .then(function() { - expect(gd._fullLayout.scene.camera.up.x).toEqual(0, 'camera.up.x'); - expect(gd._fullLayout.scene.camera.up.y).toEqual(0, 'camera.up.y'); - expect(gd._fullLayout.scene.camera.up.z).toEqual(1, 'camera.up.z'); - expect(gd._fullLayout.scene.camera.eye.x).toEqual(1.2, 'camera.eye.x'); - expect(gd._fullLayout.scene.camera.eye.y).toEqual(1.2, 'camera.eye.y'); - expect(gd._fullLayout.scene.camera.eye.z).toEqual(1.2, 'camera.eye.z'); - expect(gd._fullLayout.scene.camera.center.x).toEqual(0, 'camera.center.x'); - expect(gd._fullLayout.scene.camera.center.y).toEqual(0, 'camera.center.y'); - expect(gd._fullLayout.scene.camera.center.z).toEqual(0, 'camera.center.z'); - - expect(gd._fullLayout.scene._scene.glplot.camera.up[0]).toEqual(0, 'camera.up[0]'); - expect(gd._fullLayout.scene._scene.glplot.camera.up[1]).toEqual(0, 'camera.up[1]'); - expect(gd._fullLayout.scene._scene.glplot.camera.up[2]).toEqual(1, 'camera.up[2]'); - expect(gd._fullLayout.scene._scene.glplot.camera.eye[0]).toBeCloseTo(1.2, 6, 'camera.eye[0]'); - expect(gd._fullLayout.scene._scene.glplot.camera.eye[1]).toBeCloseTo(1.2, 6, 'camera.eye[1]'); - expect(gd._fullLayout.scene._scene.glplot.camera.eye[2]).toBeCloseTo(1.2, 6, 'camera.eye[2]'); - expect(gd._fullLayout.scene._scene.glplot.camera.center[0]).toEqual(0, 'camera.center[0]'); - expect(gd._fullLayout.scene._scene.glplot.camera.center[1]).toEqual(0, 'camera.center[1]'); - expect(gd._fullLayout.scene._scene.glplot.camera.center[2]).toEqual(0, 'camera.center[2]'); + var cameraAfter = gd._fullLayout.scene._scene.glplot.camera; + expect(cameraAfter.up[0]).toBeCloseTo(0, 3, 'cameraAfter.up[0]'); + expect(cameraAfter.up[1]).toBeCloseTo(0, 3, 'cameraAfter.up[1]'); + expect(cameraAfter.up[2]).toBeCloseTo(1, 3, 'cameraAfter.up[2]'); + expect(cameraAfter.center[0]).toBeCloseTo(0, 3, 'cameraAfter.center[0]'); + expect(cameraAfter.center[1]).toBeCloseTo(0, 3, 'cameraAfter.center[1]'); + expect(cameraAfter.center[2]).toBeCloseTo(0, 3, 'cameraAfter.center[2]'); + expect(cameraAfter.eye[0]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[0]'); + expect(cameraAfter.eye[1]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[1]'); + expect(cameraAfter.eye[2]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[2]'); }) .then(done); }); @@ -433,10 +448,7 @@ describe('Test gl3d plots', function() { // N.B. gl3d click events are 'mouseover' events // with button 1 pressed function _click() { - var x = 605; - var y = 271; - mouseEvent('mousemove', x, y); - mouseEvent('mouseover', x, y, {buttons: 1}); + mouseEvent('mouseover', 605, 271, {buttons: 1}); return delay(20)(); } From 5b8406acf58ecec71c444cd161aa6b20f42adac1 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 15:02:47 -0500 Subject: [PATCH 03/13] improved the test --- test/jasmine/tests/gl3d_plot_interact_test.js | 170 ++++++++++-------- 1 file changed, 97 insertions(+), 73 deletions(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 55c3e14371f..9134e126284 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -21,52 +21,12 @@ function countCanvases() { return d3.selectAll('canvas').size(); } -describe('Test gl3d plots', function() { - var gd, ptData; +describe('Test gl3d before/after plot', function() { + var gd; var mock = require('@mocks/gl3d_marker-arrays.json'); - var multipleScatter3dMock = require('@mocks/gl3d_multiple-scatter3d-traces.json'); - - // lines, markers, text, error bars and surfaces each - // correspond to one glplot object - var mock2 = Lib.extendDeep({}, mock); - mock2.data[0].mode = 'lines+markers+text'; - mock2.data[0].error_z = { value: 10 }; - mock2.data[0].surfaceaxis = 2; - mock2.layout.showlegend = true; - - var mock3 = require('@mocks/gl3d_autocolorscale'); - - function assertHoverText(xLabel, yLabel, zLabel, textLabel) { - var content = []; - if(xLabel) content.push(xLabel); - if(yLabel) content.push(yLabel); - if(zLabel) content.push(zLabel); - if(textLabel) content.push(textLabel); - assertHoverLabelContent({nums: content.join('\n')}); - } - - function assertEventData(x, y, z, curveNumber, pointNumber, extra) { - expect(Object.keys(ptData)).toEqual(jasmine.arrayContaining([ - 'x', 'y', 'z', - 'data', 'fullData', 'curveNumber', 'pointNumber' - ]), 'correct hover data fields'); - - expect(ptData.x).toEqual(x, 'x val'); - expect(ptData.y).toEqual(y, 'y val'); - expect(ptData.z).toEqual(z, 'z val'); - expect(ptData.curveNumber).toEqual(curveNumber, 'curveNumber'); - expect(ptData.pointNumber).toEqual(pointNumber, 'pointNumber'); - - Object.keys(extra || {}).forEach(function(k) { - expect(ptData[k]).toBe(extra[k], k + ' val'); - }); - } beforeEach(function() { - gd = createGraphDiv(); - ptData = {}; - jasmine.DEFAULT_TIMEOUT_INTERVAL = 4000; }); @@ -100,22 +60,26 @@ describe('Test gl3d plots', function() { } } }, - mock2 + mock ); - // N.B. gl3d click events are 'mouseover' events - // with button 1 pressed - function _click() { - mouseEvent('mouseover', 605, 271, {buttons: 1}); + var x = 605; + var y = 271; + + function _stayThere() { + mouseEvent('mousemove', x, y); return delay(20)(); } - Plotly.plot(gd, _mock) - .then(delay(20)) + function _clickThere() { + mouseEvent('mouseover', x, y, {buttons: 1}); + return delay(20)(); + } + + _stayThere() .then(function() { - gd.on('plotly_click', function(eventData) { - ptData = eventData.points[0]; - }); + gd = createGraphDiv(); + return Plotly.plot(gd, _mock); }) .then(delay(20)) .then(function() { @@ -129,35 +93,95 @@ describe('Test gl3d plots', function() { expect(cameraIn.eye.x).toEqual(1.2, 'cameraIn.eye.x'); expect(cameraIn.eye.y).toEqual(1.2, 'cameraIn.eye.y'); expect(cameraIn.eye.z).toEqual(1.2, 'cameraIn.eye.z'); - - var cameraBefore = gd._fullLayout.scene._scene.glplot.camera; - expect(cameraBefore.up[0]).toBeCloseTo(0, 3, 'cameraBefore.up[0]'); - expect(cameraBefore.up[1]).toBeCloseTo(0, 3, 'cameraBefore.up[1]'); - expect(cameraBefore.up[2]).toBeCloseTo(1, 3, 'cameraBefore.up[2]'); - expect(cameraBefore.center[0]).toBeCloseTo(0, 3, 'cameraBefore.center[0]'); - expect(cameraBefore.center[1]).toBeCloseTo(0, 3, 'cameraBefore.center[1]'); - expect(cameraBefore.center[2]).toBeCloseTo(0, 3, 'cameraBefore.center[2]'); - expect(cameraBefore.eye[0]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[0]'); - expect(cameraBefore.eye[1]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[1]'); - expect(cameraBefore.eye[2]).toBeCloseTo(1.2, 3, 'cameraBefore.eye[2]'); }) - .then(_click) + .then(delay(20)) + .then(function() { + var cameraBefore = gd._fullLayout.scene._scene.glplot.camera; + expect(cameraBefore.up[0]).toBeCloseTo(0, 2, 'cameraBefore.up[0]'); + expect(cameraBefore.up[1]).toBeCloseTo(0, 2, 'cameraBefore.up[1]'); + expect(cameraBefore.up[2]).toBeCloseTo(1, 2, 'cameraBefore.up[2]'); + expect(cameraBefore.center[0]).toBeCloseTo(0, 2, 'cameraBefore.center[0]'); + expect(cameraBefore.center[1]).toBeCloseTo(0, 2, 'cameraBefore.center[1]'); + expect(cameraBefore.center[2]).toBeCloseTo(0, 2, 'cameraBefore.center[2]'); + expect(cameraBefore.eye[0]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[0]'); + expect(cameraBefore.eye[1]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[1]'); + expect(cameraBefore.eye[2]).toBeCloseTo(1.2, 2, 'cameraBefore.eye[2]'); + expect(cameraBefore.mouseListener.enabled === true); + }) + .then(_clickThere) .then(delay(20)) .then(function() { var cameraAfter = gd._fullLayout.scene._scene.glplot.camera; - expect(cameraAfter.up[0]).toBeCloseTo(0, 3, 'cameraAfter.up[0]'); - expect(cameraAfter.up[1]).toBeCloseTo(0, 3, 'cameraAfter.up[1]'); - expect(cameraAfter.up[2]).toBeCloseTo(1, 3, 'cameraAfter.up[2]'); - expect(cameraAfter.center[0]).toBeCloseTo(0, 3, 'cameraAfter.center[0]'); - expect(cameraAfter.center[1]).toBeCloseTo(0, 3, 'cameraAfter.center[1]'); - expect(cameraAfter.center[2]).toBeCloseTo(0, 3, 'cameraAfter.center[2]'); - expect(cameraAfter.eye[0]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[0]'); - expect(cameraAfter.eye[1]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[1]'); - expect(cameraAfter.eye[2]).not.toBeCloseTo(1.2, 3, 'cameraAfter.eye[2]'); + expect(cameraAfter.up[0]).toBeCloseTo(0, 2, 'cameraAfter.up[0]'); + expect(cameraAfter.up[1]).toBeCloseTo(0, 2, 'cameraAfter.up[1]'); + expect(cameraAfter.up[2]).toBeCloseTo(1, 2, 'cameraAfter.up[2]'); + expect(cameraAfter.center[0]).toBeCloseTo(0, 2, 'cameraAfter.center[0]'); + expect(cameraAfter.center[1]).toBeCloseTo(0, 2, 'cameraAfter.center[1]'); + expect(cameraAfter.center[2]).toBeCloseTo(0, 2, 'cameraAfter.center[2]'); + expect(cameraAfter.eye[0]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[0]'); + expect(cameraAfter.eye[1]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[1]'); + expect(cameraAfter.eye[2]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[2]'); + expect(cameraAfter.mouseListener.enabled === true); }) .then(done); }); +}); + +describe('Test gl3d plots', function() { + var gd, ptData; + + var mock = require('@mocks/gl3d_marker-arrays.json'); + var multipleScatter3dMock = require('@mocks/gl3d_multiple-scatter3d-traces.json'); + + // lines, markers, text, error bars and surfaces each + // correspond to one glplot object + var mock2 = Lib.extendDeep({}, mock); + mock2.data[0].mode = 'lines+markers+text'; + mock2.data[0].error_z = { value: 10 }; + mock2.data[0].surfaceaxis = 2; + mock2.layout.showlegend = true; + + var mock3 = require('@mocks/gl3d_autocolorscale'); + + function assertHoverText(xLabel, yLabel, zLabel, textLabel) { + var content = []; + if(xLabel) content.push(xLabel); + if(yLabel) content.push(yLabel); + if(zLabel) content.push(zLabel); + if(textLabel) content.push(textLabel); + assertHoverLabelContent({nums: content.join('\n')}); + } + + function assertEventData(x, y, z, curveNumber, pointNumber, extra) { + expect(Object.keys(ptData)).toEqual(jasmine.arrayContaining([ + 'x', 'y', 'z', + 'data', 'fullData', 'curveNumber', 'pointNumber' + ]), 'correct hover data fields'); + + expect(ptData.x).toEqual(x, 'x val'); + expect(ptData.y).toEqual(y, 'y val'); + expect(ptData.z).toEqual(z, 'z val'); + expect(ptData.curveNumber).toEqual(curveNumber, 'curveNumber'); + expect(ptData.pointNumber).toEqual(pointNumber, 'pointNumber'); + + Object.keys(extra || {}).forEach(function(k) { + expect(ptData[k]).toBe(extra[k], k + ' val'); + }); + } + + beforeEach(function() { + gd = createGraphDiv(); + ptData = {}; + + jasmine.DEFAULT_TIMEOUT_INTERVAL = 4000; + }); + + afterEach(function() { + Plotly.purge(gd); + destroyGraphDiv(); + }); + it('@noCI @gl should display correct hover labels of the second point of the very first scatter3d trace', function(done) { var _mock = Lib.extendDeep({}, multipleScatter3dMock); From c7593963f11171797cf1248dd76d83fe408d2ca3 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 15:03:32 -0500 Subject: [PATCH 04/13] added a getter and setter --- src/plots/gl3d/scene.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index 478a4eebe17..d5de2ead7c6 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -355,8 +355,7 @@ function Scene(options, fullLayout) { initializeGLPlot(this, camera, this.pixelRatio); - // enable mouse listener which was disabled at camera init - this.camera.mouseListener.enabled = true; + this.enableGLCameraMouseListener(); } var proto = Scene.prototype; @@ -376,7 +375,14 @@ proto.initializeGLCamera = function() { mode: 'orbit' }); - // Note: we shoule disable camera interactions until the scene is complete + this.disableGLCameraMouseListener(); +}; + +proto.enableGLCameraMouseListener = function() { + this.camera.mouseListener.enabled = true; +}; + +proto.disableGLCameraMouseListener = function() { this.camera.mouseListener.enabled = false; }; From 66da760325c685d0059a058210b87bc467060936 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 16:42:19 -0500 Subject: [PATCH 05/13] fixed camera init to avoid multiple calls to create camera and resuse the identical camera object in creating gl3d scene --- package-lock.json | 5 ++--- package.json | 2 +- src/plots/gl3d/scene.js | 18 ++++++++---------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/package-lock.json b/package-lock.json index 83f7ca27609..57faff668bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4998,9 +4998,8 @@ } }, "gl-plot3d": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/gl-plot3d/-/gl-plot3d-2.1.1.tgz", - "integrity": "sha512-a4wmasRlBxLmC9v1JihkLSjnKU2Di3X5fanxyx6B/NW8uOdeFrdheQ+q7HI+zwvYgjrS5kGAn2i9mADsPH1xJg==", + "version": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", + "from": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", "requires": { "3d-view": "^2.0.0", "a-big-triangle": "^1.0.3", diff --git a/package.json b/package.json index 0463841fda8..9db25e963f5 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.8", "gl-plot2d": "^1.4.2", - "gl-plot3d": "^2.1.1", + "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", "gl-pointcloud2d": "^1.0.2", "gl-scatter3d": "^1.2.0", "gl-select-box": "^1.0.3", diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index d5de2ead7c6..71a9da8a029 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -192,7 +192,7 @@ function render(scene) { scene.drawAnnotations(scene); } -function tryCreatePlot(scene, camera, pixelRatio, canvas, gl) { +function tryCreatePlot(scene, cameraObject, pixelRatio, canvas, gl) { var glplotOptions = { canvas: canvas, @@ -204,7 +204,7 @@ function tryCreatePlot(scene, camera, pixelRatio, canvas, gl) { snapToData: true, autoScale: true, autoBounds: false, - camera: camera, + cameraObject: cameraObject, pixelRatio: pixelRatio }; @@ -238,9 +238,11 @@ function tryCreatePlot(scene, camera, pixelRatio, canvas, gl) { return true; } -function initializeGLPlot(scene, camera, pixelRatio, canvas, gl) { +function initializeGLPlot(scene, pixelRatio, canvas, gl) { - var success = tryCreatePlot(scene, camera, pixelRatio, canvas, gl); + scene.initializeGLCamera(); + + var success = tryCreatePlot(scene, scene.camera, pixelRatio, canvas, gl); /* * createPlot will throw when webgl is not enabled in the client. * Lets return an instance of the module with all functions noop'd. @@ -281,8 +283,6 @@ function initializeGLPlot(scene, camera, pixelRatio, canvas, gl) { }, false); } - if(!scene.camera) scene.initializeGLCamera(); - scene.glplot.camera = scene.camera; scene.glplot.oncontextloss = function() { @@ -351,9 +351,7 @@ function Scene(options, fullLayout) { this.convertAnnotations = Registry.getComponentMethod('annotations3d', 'convert'); this.drawAnnotations = Registry.getComponentMethod('annotations3d', 'draw'); - var camera = fullLayout.scene.camera; - - initializeGLPlot(this, camera, this.pixelRatio); + initializeGLPlot(this, this.pixelRatio); this.enableGLCameraMouseListener(); } @@ -808,7 +806,7 @@ proto.setCamera = function setCamera(cameraData) { this.glplot.dispose(); - initializeGLPlot(this, cameraData, pixelRatio); + initializeGLPlot(this, pixelRatio); this.glplot.camera._ortho = newOrtho; } }; From e48c8203f8f485e2df52b8c90a10902e8228ccd9 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 17:06:50 -0500 Subject: [PATCH 06/13] fix gl-plot3d link now use ortho attribute when passing camera object in --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 57faff668bf..957acf269a9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4998,8 +4998,8 @@ } }, "gl-plot3d": { - "version": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", - "from": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", + "version": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", + "from": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", "requires": { "3d-view": "^2.0.0", "a-big-triangle": "^1.0.3", diff --git a/package.json b/package.json index 9db25e963f5..195919b482f 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.8", "gl-plot2d": "^1.4.2", - "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#8974522a2b56120766d34d4e509f292a718b7f3e", + "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", "gl-pointcloud2d": "^1.0.2", "gl-scatter3d": "^1.2.0", "gl-select-box": "^1.0.3", From 6bd58c922ee5d43ca780491739b7293744fa1189 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 27 Feb 2019 23:40:26 -0500 Subject: [PATCH 07/13] improved gl-plot3d scene and camera modules to fixed issue 3576 - lock jasmine test --- package-lock.json | 4 +-- package.json | 2 +- src/plots/gl3d/scene.js | 12 --------- test/jasmine/tests/gl3d_plot_interact_test.js | 26 ++++++++++++++++--- 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/package-lock.json b/package-lock.json index 957acf269a9..2ef10c2138a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4998,8 +4998,8 @@ } }, "gl-plot3d": { - "version": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", - "from": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", + "version": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", + "from": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", "requires": { "3d-view": "^2.0.0", "a-big-triangle": "^1.0.3", diff --git a/package.json b/package.json index 195919b482f..2ad96ae21db 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.8", "gl-plot2d": "^1.4.2", - "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#7f63b591d13a3065a05a23a5d5a55d2b0480f225", + "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", "gl-pointcloud2d": "^1.0.2", "gl-scatter3d": "^1.2.0", "gl-select-box": "^1.0.3", diff --git a/src/plots/gl3d/scene.js b/src/plots/gl3d/scene.js index 71a9da8a029..fb4227832cb 100644 --- a/src/plots/gl3d/scene.js +++ b/src/plots/gl3d/scene.js @@ -352,8 +352,6 @@ function Scene(options, fullLayout) { this.drawAnnotations = Registry.getComponentMethod('annotations3d', 'draw'); initializeGLPlot(this, this.pixelRatio); - - this.enableGLCameraMouseListener(); } var proto = Scene.prototype; @@ -372,16 +370,6 @@ proto.initializeGLCamera = function() { zoomMax: 100, mode: 'orbit' }); - - this.disableGLCameraMouseListener(); -}; - -proto.enableGLCameraMouseListener = function() { - this.camera.mouseListener.enabled = true; -}; - -proto.disableGLCameraMouseListener = function() { - this.camera.mouseListener.enabled = false; }; proto.recoverContext = function() { diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 9134e126284..4ca0b9e1989 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -76,6 +76,11 @@ describe('Test gl3d before/after plot', function() { return delay(20)(); } + function _clickOtherplace() { + mouseEvent('mouseover', 300, 300, {buttons: 1}); + return delay(20)(); + } + _stayThere() .then(function() { gd = createGraphDiv(); @@ -118,11 +123,26 @@ describe('Test gl3d before/after plot', function() { expect(cameraAfter.center[0]).toBeCloseTo(0, 2, 'cameraAfter.center[0]'); expect(cameraAfter.center[1]).toBeCloseTo(0, 2, 'cameraAfter.center[1]'); expect(cameraAfter.center[2]).toBeCloseTo(0, 2, 'cameraAfter.center[2]'); - expect(cameraAfter.eye[0]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[0]'); - expect(cameraAfter.eye[1]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[1]'); - expect(cameraAfter.eye[2]).not.toBeCloseTo(1.2, 2, 'cameraAfter.eye[2]'); + expect(cameraAfter.eye[0]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[0]'); + expect(cameraAfter.eye[1]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[1]'); + expect(cameraAfter.eye[2]).toBeCloseTo(1.2, 2, 'cameraAfter.eye[2]'); expect(cameraAfter.mouseListener.enabled === true); }) + .then(_clickOtherplace) + .then(delay(20)) + .then(function() { + var cameraFinal = gd._fullLayout.scene._scene.glplot.camera; + expect(cameraFinal.up[0]).toBeCloseTo(0, 2, 'cameraFinal.up[0]'); + expect(cameraFinal.up[1]).toBeCloseTo(0, 2, 'cameraFinal.up[1]'); + expect(cameraFinal.up[2]).toBeCloseTo(1, 2, 'cameraFinal.up[2]'); + expect(cameraFinal.center[0]).toBeCloseTo(0, 2, 'cameraFinal.center[0]'); + expect(cameraFinal.center[1]).toBeCloseTo(0, 2, 'cameraFinal.center[1]'); + expect(cameraFinal.center[2]).toBeCloseTo(0, 2, 'cameraFinal.center[2]'); + expect(cameraFinal.eye[0]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[0]'); + expect(cameraFinal.eye[1]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[1]'); + expect(cameraFinal.eye[2]).not.toBeCloseTo(1.2, 2, 'cameraFinal.eye[2]'); + expect(cameraFinal.mouseListener.enabled === true); + }) .then(done); }); From a200e78e8e315d78d6bd55f94a415b51bd449fb6 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 28 Feb 2019 00:03:18 -0500 Subject: [PATCH 08/13] added noCI flag for the jasmine test --- test/jasmine/tests/gl3d_plot_interact_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 4ca0b9e1989..eb9ba45a076 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -35,7 +35,7 @@ describe('Test gl3d before/after plot', function() { destroyGraphDiv(); }); - it('@gl should not rotate camera on the very first click before scene is complete and then should rotate', function(done) { + it('@noCI @gl should not rotate camera on the very first click before scene is complete and then should rotate', function(done) { var _mock = Lib.extendDeep( { layout: { From 4b035d6b8d6946bfa7a157a2a414d5eefd1f0706 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 7 Mar 2019 14:37:55 -0500 Subject: [PATCH 09/13] was able to remove noci flag from some of gl3d jasmine tests --- test/jasmine/tests/gl3d_plot_interact_test.js | 4 ++-- test/jasmine/tests/isosurface_test.js | 2 +- test/jasmine/tests/streamtube_test.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 413e63677e6..5eef634b126 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -202,7 +202,7 @@ describe('Test gl3d plots', function() { destroyGraphDiv(); }); - it('@noCI @gl should display correct hover labels of the second point of the very first scatter3d trace', function(done) { + it('@gl should display correct hover labels of the second point of the very first scatter3d trace', function(done) { var _mock = Lib.extendDeep({}, multipleScatter3dMock); function _hover() { @@ -486,7 +486,7 @@ describe('Test gl3d plots', function() { .then(done); }); - it('@noCI @gl should emit correct event data on click (scatter3d case)', function(done) { + it('@gl should emit correct event data on click (scatter3d case)', function(done) { var _mock = Lib.extendDeep({}, mock2); // N.B. gl3d click events are 'mouseover' events diff --git a/test/jasmine/tests/isosurface_test.js b/test/jasmine/tests/isosurface_test.js index d935436574b..848bfe79e3e 100644 --- a/test/jasmine/tests/isosurface_test.js +++ b/test/jasmine/tests/isosurface_test.js @@ -313,7 +313,7 @@ describe('Test isosurface', function() { }); }); - describe('@noCI hover', function() { + describe('hover', function() { var gd; diff --git a/test/jasmine/tests/streamtube_test.js b/test/jasmine/tests/streamtube_test.js index 43528a8df9a..c41befbe738 100644 --- a/test/jasmine/tests/streamtube_test.js +++ b/test/jasmine/tests/streamtube_test.js @@ -295,7 +295,7 @@ describe('Test streamtube interactions', function() { }); }); -describe('@noCI Test streamtube hover', function() { +describe('Test streamtube hover', function() { var gd; beforeEach(function() { From e3ec0e474cacc701c11254f655c1a746baa7237e Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 7 Mar 2019 16:59:19 -0500 Subject: [PATCH 10/13] gl3d jasmine tests run on CI --- test/jasmine/tests/gl3d_plot_interact_test.js | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 5eef634b126..1dcaef2246e 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -218,7 +218,6 @@ describe('Test gl3d plots', function() { }); }) .then(_hover) - .then(delay(20)) .then(function() { assertHoverLabelContent( { @@ -231,11 +230,12 @@ describe('Test gl3d plots', function() { .then(done); }); - it('@noCI @gl should display correct hover labels and emit correct event data (scatter3d case)', function(done) { + it('@gl should display correct hover labels and emit correct event data (scatter3d case)', function(done) { var _mock = Lib.extendDeep({}, mock2); function _hover() { - mouseEvent('mouseover', 605, 271); + mouseEvent('mouseover', 0, 0) + mouseEvent('mouseover', 655, 221); return delay(20)(); } @@ -247,14 +247,13 @@ describe('Test gl3d plots', function() { }); }) .then(_hover) - .then(delay(20)) .then(function() { - assertHoverText('x: 134.03', 'y: −163.59', 'z: −163.59'); - assertEventData(134.03, -163.59, -163.59, 0, 3, { - 'marker.symbol': undefined, - 'marker.size': 40, - 'marker.color': 'black', - 'marker.line.color': undefined + assertHoverText('x: 100.75', 'y: −102.63', 'z: −102.63'); + assertEventData(100.75, -102.63, -102.63, 0, 0, { + 'marker.symbol': 'circle', + 'marker.size': 10, + 'marker.color': 'blue', + 'marker.line.color': 'black' }); assertHoverLabelStyle(d3.selectAll('g.hovertext'), { bgcolor: 'rgb(0, 0, 255)', @@ -270,7 +269,7 @@ describe('Test gl3d plots', function() { }) .then(_hover) .then(function() { - assertHoverText('x: Feb 1, 2017', 'y: −163.59', 'z: −163.59'); + assertHoverText('x: Jan 11, 2016', 'y: −102.63', 'z: −102.63'); return Plotly.restyle(gd, { x: [[new Date(2017, 2, 1), new Date(2017, 2, 2), new Date(2017, 2, 3), new Date(2017, 2, 4)]] @@ -278,7 +277,7 @@ describe('Test gl3d plots', function() { }) .then(_hover) .then(function() { - assertHoverText('x: Mar 4, 2017', 'y: −163.59', 'z: −163.59'); + assertHoverText('x: Mar 1, 2017', 'y: −102.63', 'z: −102.63'); return Plotly.update(gd, { y: [['a', 'b', 'c', 'd']], @@ -289,25 +288,25 @@ describe('Test gl3d plots', function() { }) .then(_hover) .then(function() { - assertHoverText('x: Mar 4, 2017', 'y: d', 'z: 10B'); + assertHoverText('x: Mar 1, 2017', 'y: a', 'z: 10'); return Plotly.relayout(gd, 'scene.xaxis.calendar', 'chinese'); }) .then(_hover) .then(function() { - assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B'); + assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10'); return Plotly.restyle(gd, 'text', [['A', 'B', 'C', 'D']]); }) .then(_hover) .then(function() { - assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'D'); + assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'A'); return Plotly.restyle(gd, 'hovertext', [['Apple', 'Banana', 'Clementine', 'Dragon fruit']]); }) .then(_hover) .then(function() { - assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'Dragon fruit'); + assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'Apple'); return Plotly.restyle(gd, { 'hoverlabel.bgcolor': [['red', 'blue', 'green', 'yellow']], @@ -317,11 +316,11 @@ describe('Test gl3d plots', function() { .then(_hover) .then(function() { assertHoverLabelStyle(d3.selectAll('g.hovertext'), { - bgcolor: 'rgb(255, 255, 0)', - bordercolor: 'rgb(68, 68, 68)', + bgcolor: 'rgb(255, 0, 0)', + bordercolor: 'rgb(255, 255, 255)', fontSize: 20, fontFamily: 'Arial', - fontColor: 'rgb(68, 68, 68)' + fontColor: 'rgb(255, 255, 255)' }, 'restyled'); return Plotly.relayout(gd, { @@ -333,7 +332,7 @@ describe('Test gl3d plots', function() { .then(_hover) .then(function() { assertHoverLabelStyle(d3.selectAll('g.hovertext'), { - bgcolor: 'rgb(255, 255, 0)', + bgcolor: 'rgb(255, 0, 0)', bordercolor: 'rgb(255, 255, 0)', fontSize: 20, fontFamily: 'Roboto', @@ -347,18 +346,18 @@ describe('Test gl3d plots', function() { var label = d3.selectAll('g.hovertext'); expect(label.size()).toEqual(1); - expect(label.select('text').text()).toEqual('x: 二 7, 2017y: dz: 10BDragon fruit'); + expect(label.select('text').text()).toEqual('x: 二 4, 2017y: az: 10Apple'); return Plotly.restyle(gd, 'hoverinfo', [[null, null, 'dont+know', null]]); }) .then(_hover) .then(function() { - assertHoverText('x: 二 7, 2017', 'y: d', 'z: 10B', 'Dragon fruit'); + assertHoverText('x: 二 4, 2017', 'y: a', 'z: 10', 'Apple'); return Plotly.restyle(gd, 'hoverinfo', 'text'); }) .then(function() { - assertHoverText(null, null, null, 'Dragon fruit'); + assertHoverText(null, null, null, 'Apple'); return Plotly.restyle(gd, 'hovertext', 'HEY'); }) @@ -368,18 +367,18 @@ describe('Test gl3d plots', function() { return Plotly.restyle(gd, 'hoverinfo', 'z'); }) .then(function() { - assertHoverText(null, null, '10B'); + assertHoverText(null, null, '10'); return Plotly.restyle(gd, 'hovertemplate', 'THIS Y -- %{y}'); }) .then(function() { - assertHoverText(null, null, null, 'THIS Y -- d'); + assertHoverText(null, null, null, 'THIS Y -- a'); }) .catch(failTest) .then(done); }); - it('@noCI @gl should display correct hover labels and emit correct event data (surface case)', function(done) { + it('@gl should display correct hover labels and emit correct event data (surface case)', function(done) { var _mock = Lib.extendDeep({}, mock3); function _hover() { @@ -395,7 +394,6 @@ describe('Test gl3d plots', function() { }); }) .then(_hover) - .then(delay(20)) .then(function() { assertHoverText('x: 1', 'y: 2', 'z: 43', 'one two'); assertEventData(1, 2, 43, 0, [1, 2]); From 98b28ac2c7465cd3d25cd71b0303a2d3729ba8f3 Mon Sep 17 00:00:00 2001 From: archmoj Date: Thu, 7 Mar 2019 21:40:12 -0500 Subject: [PATCH 11/13] fixed syntax --- test/jasmine/tests/gl3d_plot_interact_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 1dcaef2246e..97e61a0998e 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -234,7 +234,7 @@ describe('Test gl3d plots', function() { var _mock = Lib.extendDeep({}, mock2); function _hover() { - mouseEvent('mouseover', 0, 0) + mouseEvent('mouseover', 0, 0); mouseEvent('mouseover', 655, 221); return delay(20)(); } From 25b78edf2e6dd2f7f827e3a6edcc5ab6c4bdf97d Mon Sep 17 00:00:00 2001 From: archmoj Date: Tue, 19 Mar 2019 22:33:15 -0400 Subject: [PATCH 12/13] resolved conflicts in gl-plot3d --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08a00099ac9..ed025af8594 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4998,8 +4998,8 @@ } }, "gl-plot3d": { - "version": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", - "from": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", + "version": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", + "from": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", "requires": { "3d-view": "^2.0.0", "a-big-triangle": "^1.0.3", diff --git a/package.json b/package.json index 879e16fb9a5..66087bf5bf2 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.8", "gl-plot2d": "^1.4.2", - "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#5f28e06ac02b248e6990ef385d2df49bb3a7baf8", + "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", "gl-pointcloud2d": "^1.0.2", "gl-scatter3d": "^1.2.0", "gl-select-box": "^1.0.3", From 6f0330babddebae7efb494d9bfb2ab19646f3b44 Mon Sep 17 00:00:00 2001 From: archmoj Date: Wed, 20 Mar 2019 11:00:16 -0400 Subject: [PATCH 13/13] add the missing gl tag on one test and bump gl-plot3d 2.2.0 --- package-lock.json | 5 +++-- package.json | 2 +- test/jasmine/tests/isosurface_test.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 447bd29a1ba..895198d1bdb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4998,8 +4998,9 @@ } }, "gl-plot3d": { - "version": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", - "from": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/gl-plot3d/-/gl-plot3d-2.2.0.tgz", + "integrity": "sha512-8p65Bfm485YrzujXMmq4JrfuUC7YG5dYCI9udk8ghvLyfGvLvzBKgarjlZzlGTsB8e831PKDiG9UFEyQmCIzGg==", "requires": { "3d-view": "^2.0.0", "a-big-triangle": "^1.0.3", diff --git a/package.json b/package.json index d7887032e42..83842e38f45 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-mat4": "^1.2.0", "gl-mesh3d": "^2.0.8", "gl-plot2d": "^1.4.2", - "gl-plot3d": "git://github.com/gl-vis/gl-plot3d.git#597e656e97a0793d40ff198a94c7621ef56bdcd1", + "gl-plot3d": "^2.2.0", "gl-pointcloud2d": "^1.0.2", "gl-scatter3d": "^1.2.0", "gl-select-box": "^1.0.3", diff --git a/test/jasmine/tests/isosurface_test.js b/test/jasmine/tests/isosurface_test.js index 848bfe79e3e..90bfc0ef293 100644 --- a/test/jasmine/tests/isosurface_test.js +++ b/test/jasmine/tests/isosurface_test.js @@ -269,7 +269,7 @@ describe('Test isosurface', function() { destroyGraphDiv(); }); - it('should clear *cauto* when restyle *cmin* and/or *cmax*', function(done) { + it('@gl should clear *cauto* when restyle *cmin* and/or *cmax*', function(done) { function _assert(user, full) { var trace = gd.data[0];