diff --git a/package-lock.json b/package-lock.json index d4229ec26c4..f5e6097fe68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5026,9 +5026,9 @@ } }, "gl-surface3d": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/gl-surface3d/-/gl-surface3d-1.3.4.tgz", - "integrity": "sha512-qQ8DeyPzB6u+EosBTNQ0WVQ63mBKoUtXtWcHhmMTCHG8k9iyHGMdtkXtp63vFaB0C1YIIMeYxtkrkqmqrptHBg==", + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/gl-surface3d/-/gl-surface3d-1.3.5.tgz", + "integrity": "sha512-+8/zQKgVvaGee1KYcfM6bnNsfa0UtVwERQymeu4N1il16qK1b+Dgp2y+lzyM97J5Tez0qyDw2BbkOrmve3+8YQ==", "requires": { "binary-search-bounds": "1.0.0", "bit-twiddle": "1.0.2", diff --git a/package.json b/package.json index 56120b15054..cdf5211e851 100644 --- a/package.json +++ b/package.json @@ -82,7 +82,7 @@ "gl-scatter3d": "^1.0.11", "gl-select-box": "^1.0.2", "gl-spikes2d": "^1.0.1", - "gl-surface3d": "^1.3.4", + "gl-surface3d": "^1.3.5", "glslify": "^6.1.1", "has-hover": "^1.0.1", "has-passive-events": "^1.0.0", diff --git a/src/traces/surface/convert.js b/src/traces/surface/convert.js index 5a774b2c788..5f0f689de6c 100644 --- a/src/traces/surface/convert.js +++ b/src/traces/surface/convert.js @@ -342,6 +342,7 @@ proto.update = function(data) { surface.visible = data.visible; surface.enableDynamic = highlightEnable; + surface.enableHighlight = highlightEnable; surface.snapToData = true; diff --git a/test/image/baselines/gl3d_contour-lines2.png b/test/image/baselines/gl3d_contour-lines2.png new file mode 100644 index 00000000000..6603f849736 Binary files /dev/null and b/test/image/baselines/gl3d_contour-lines2.png differ diff --git a/test/image/mocks/gl3d_contour-lines2.json b/test/image/mocks/gl3d_contour-lines2.json new file mode 100644 index 00000000000..31c921ade73 --- /dev/null +++ b/test/image/mocks/gl3d_contour-lines2.json @@ -0,0 +1,826 @@ +{ + "data": [ + { + "x": [ + 500, + 750, + 1000, + 1250, + 1500, + 1750, + 2000, + 2250, + 2500, + 2750, + 3000, + 3500, + 4000, + 4500, + 5000, + 5500, + 6000, + 6500 + ], + "y": [ + 0, + 0.05, + 0.1, + 0.15, + 0.2, + 0.25, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1, + 1.1, + 1.2, + 1.3, + 1.4, + 1.5, + 1.6, + 1.7, + 1.8, + 1.9, + 2, + 2.1, + 2.2, + 2.3, + 2.4 + ], + "z": [ + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.961, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ], + [ + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 1, + 0.938, + 0.961, + 0.961, + 0.898, + 0.898, + 0.898, + 0.898, + 0.898 + ] + ], + "type": "surface", + "contours": { + "x": { + "show": true, + "color": "#000", + "width": 1, + "highlight": false + }, + "y": { + "show": true, + "color": "#000", + "width": 1, + "highlight": false + }, + "z": { + "show": false, + "highlight": false + } + }, + "colorscale": [ + [ + 0, + "#0f0" + ], + [ + 0.5, + "#ff0" + ], + [ + 1, + "#f00" + ] + ], + "cmin": 0.898, + "cmax": 1, + "cauto": true + } + ], + "layout": { + "width": 1000, + "height": 600, + "margin": { + "l": 1, + "r": 0, + "t": 0, + "b": 0 + }, + "scene": { + "xaxis": { + "tickvals": [ + 500, + 750, + 1000, + 1250, + 1500, + 1750, + 2000, + 2250, + 2500, + 2750, + 3000, + 3500, + 4000, + 4500, + 5000, + 5500, + 6000, + 6500 + ], + "ticktext": [ + "500", + "", + "", + "1250", + "", + "", + "2000", + "", + "", + "2750", + "", + "3500", + "", + "4500", + "", + "5500", + "", + "6500" + ], + "type": "linear" + }, + "yaxis": { + "tickvals": [ + 0, + 0.05, + 0.1, + 0.15, + 0.2, + 0.25, + 0.3, + 0.4, + 0.5, + 0.6, + 0.7, + 0.8, + 0.9, + 1, + 1.1, + 1.2, + 1.3, + 1.4, + 1.5, + 1.6, + 1.7, + 1.8, + 1.9, + 2, + 2.1, + 2.2, + 2.3, + 2.4 + ], + "ticktext": [ + "0", + "", + "", + "", + "0.2", + "", + "", + "0.4", + "", + "0.6", + "", + "0.8", + "", + "1.0", + "", + "1.2", + "", + "1.4", + "", + "1.6", + "", + "1.8", + "", + "2.0", + "", + "2.4" + ], + "type": "linear" + }, + "zaxis": { + "tickvals": [ + 0.895, + 0.9, + 0.905, + 0.91, + 0.915, + 0.92, + 0.925, + 0.93, + 0.935, + 0.9400000000000001, + 0.9450000000000001, + 0.9500000000000001, + 0.9550000000000001, + 0.9600000000000001, + 0.9650000000000001, + 0.9700000000000001, + 0.9750000000000001, + 0.9800000000000001, + 0.9850000000000001, + 0.9900000000000001, + 0.9950000000000001, + 1 + ], + "ticktext": [ + "0.895", + "", + "0.905", + "", + "0.915", + "", + "0.925", + "", + "0.935", + "", + "0.945", + "", + "0.955", + "", + "0.965", + "", + "0.975", + "", + "0.985", + "", + "0.995", + "" + ] + }, + "aspectratio": { + "x": 1, + "y": 1, + "z": 1 + }, + "aspectmode": "auto" + } + } +}