diff --git a/package-lock.json b/package-lock.json index e563ecbc07f..4cc24650b6d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4744,9 +4744,9 @@ } }, "gl-scatter3d": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/gl-scatter3d/-/gl-scatter3d-1.1.0.tgz", - "integrity": "sha512-8O/YXxRZloG0LPkmd5hr50IMmgbqdvQZ1axH+E90CpBrqez6D24WFJg74vPka2YJf89DIms8i6kElDlSFHCrCA==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/gl-scatter3d/-/gl-scatter3d-1.1.2.tgz", + "integrity": "sha512-gxLYR2Etqi9JodqH4TLBBpys+B5R6/IbRrN64uk81rR6K2TTyYM9LOaPVFSinFnRXeQzRwPtvjfcBHmf085i3A==", "requires": { "gl-buffer": "^2.0.6", "gl-mat4": "^1.0.0", @@ -4757,13 +4757,6 @@ "is-string-blank": "^1.0.1", "typedarray-pool": "^1.0.2", "vectorize-text": "^3.2.0" - }, - "dependencies": { - "glsl-out-of-range": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/glsl-out-of-range/-/glsl-out-of-range-1.0.3.tgz", - "integrity": "sha512-3uSoD4aX4TjHx3uRJnJbUpegePR0tRPf9VWLS7EjDMbHHV+qrKjl8ov93ifG3kqzcxIOmaSXDK248EmM5uoQ/g==" - } } }, "gl-select-box": { diff --git a/package.json b/package.json index c12c01fa678..ba09779f6fc 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "gl-plot2d": "^1.4.0", "gl-plot3d": "^1.6.1", "gl-pointcloud2d": "^1.0.1", - "gl-scatter3d": "^1.1.0", + "gl-scatter3d": "^1.1.2", "gl-select-box": "^1.0.2", "gl-spikes2d": "^1.0.1", "gl-streamtube3d": "^1.1.1", diff --git a/test/image/baselines/gl3d_multiple-scatter3d-traces.png b/test/image/baselines/gl3d_multiple-scatter3d-traces.png new file mode 100644 index 00000000000..b789252f0a1 Binary files /dev/null and b/test/image/baselines/gl3d_multiple-scatter3d-traces.png differ diff --git a/test/image/mocks/gl3d_multiple-scatter3d-traces.json b/test/image/mocks/gl3d_multiple-scatter3d-traces.json new file mode 100644 index 00000000000..34f723306ef --- /dev/null +++ b/test/image/mocks/gl3d_multiple-scatter3d-traces.json @@ -0,0 +1,40 @@ +{ + "data": [ + { + "type": "scatter3d", + "mode": "markers", + "marker": {"opacity": 1.0}, + "x": [-1, 0, 1], + "y": [0, 0, 0], + "z": [0, 0, 0] + }, + { + "type": "scatter3d", + "mode": "markers", + "marker": {"opacity": 1.0}, + "x": [-1, 0, 1], + "y": [0, 0, 0], + "z": [10, 10, 10] + }, + { + "type": "scatter3d", + "mode": "markers", + "marker": {"opacity": 1.0}, + "x": [-1, 0, 1], + "y": [0, 0, 0], + "z": [-10, -10, -10] + } + ], + "layout": { + "title": "Hovering over data points of multiple scatter3d traces", + "width": 600, + "height": 400, + "scene": { + "camera": { + "eye": {"x": 1, "y": 1, "z": 1}, + "center": {"x": 0, "y": 0, "z": 0}, + "up": {"x": 0, "y": 0, "z": 1} + } + } + } +} diff --git a/test/jasmine/tests/gl3d_plot_interact_test.js b/test/jasmine/tests/gl3d_plot_interact_test.js index 6b1ee42c3e4..77e713bc719 100644 --- a/test/jasmine/tests/gl3d_plot_interact_test.js +++ b/test/jasmine/tests/gl3d_plot_interact_test.js @@ -25,6 +25,7 @@ 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 @@ -74,6 +75,35 @@ 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) { + var _mock = Lib.extendDeep({}, multipleScatter3dMock); + + function _hover() { + mouseEvent('mouseover', 300, 200); + return delay(20)(); + } + + Plotly.plot(gd, _mock) + .then(delay(20)) + .then(function() { + gd.on('plotly_hover', function(eventData) { + ptData = eventData.points[0]; + }); + }) + .then(_hover) + .then(delay(20)) + .then(function() { + assertHoverLabelContent( + { + nums: ['x: 0', 'y: 0', 'z: 0'].join('\n'), + name: 'trace 0' + } + ); + }) + .catch(failTest) + .then(done); + }); + it('@noCI @gl should display correct hover labels and emit correct event data (scatter3d case)', function(done) { var _mock = Lib.extendDeep({}, mock2);