diff --git a/package-lock.json b/package-lock.json index 69c917e9090..221ce446edf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4852,9 +4852,9 @@ } }, "gl-surface3d": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/gl-surface3d/-/gl-surface3d-1.3.7.tgz", - "integrity": "sha512-Q8230JPRBqYb8yDR7ORDZfK3uRY0k0gmqlujPIL36SQdZ1utKSCn/dNIe9SKiqyE7ycfdIBp0Z1otZM23Nn6bA==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/gl-surface3d/-/gl-surface3d-1.4.0.tgz", + "integrity": "sha512-U0LM1LlhpUxzvqIE5IF2amlwlRcyzwGr14DnpCWy0kiTFhCMMPa7YmvUch4CiAYOWATg2YH63LsFosb+I+kwyg==", "requires": { "binary-search-bounds": "^1.0.0", "bit-twiddle": "^1.0.2", diff --git a/package.json b/package.json index d54d771e0d0..46247f4b198 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "gl-select-box": "^1.0.2", "gl-spikes2d": "^1.0.1", "gl-streamtube3d": "^1.1.1", - "gl-surface3d": "^1.3.7", + "gl-surface3d": "^1.4.0", "gl-text": "^1.1.6", "glslify": "^6.3.1", "has-hover": "^1.0.1", @@ -97,7 +97,6 @@ "ndarray": "^1.0.18", "ndarray-fill": "^1.0.2", "ndarray-homography": "^1.0.0", - "ndarray-ops": "^1.2.2", "point-cluster": "^3.1.4", "polybooljs": "^1.2.0", "regl": "^1.3.11", diff --git a/src/traces/surface/convert.js b/src/traces/surface/convert.js index 5f0f689de6c..c7e5161afc3 100644 --- a/src/traces/surface/convert.js +++ b/src/traces/surface/convert.js @@ -10,71 +10,95 @@ 'use strict'; var createSurface = require('gl-surface3d'); + var ndarray = require('ndarray'); var homography = require('ndarray-homography'); var fill = require('ndarray-fill'); -var ops = require('ndarray-ops'); var isArrayOrTypedArray = require('../../lib').isArrayOrTypedArray; var parseColorScale = require('../../lib/gl_format_color').parseColorScale; var str2RgbaArray = require('../../lib/str2rgbarray'); -var MIN_RESOLUTION = 128; - function SurfaceTrace(scene, surface, uid) { this.scene = scene; this.uid = uid; this.surface = surface; this.data = null; this.showContour = [false, false, false]; - this.dataScale = 1.0; + this.minValues = [Infinity, Infinity, Infinity]; + this.maxValues = [-Infinity, -Infinity, -Infinity]; + this.dataScaleX = 1.0; + this.dataScaleY = 1.0; + this.refineData = true; } var proto = SurfaceTrace.prototype; +proto.getXat = function(a, b, calendar, axis) { + var v = ( + (!isArrayOrTypedArray(this.data.x)) ? + a : + (isArrayOrTypedArray(this.data.x[0])) ? + this.data.x[b][a] : + this.data.x[a] + ); + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + +proto.getYat = function(a, b, calendar, axis) { + var v = ( + (!isArrayOrTypedArray(this.data.y)) ? + b : + (isArrayOrTypedArray(this.data.y[0])) ? + this.data.y[b][a] : + this.data.y[b] + ); + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + +proto.getZat = function(a, b, calendar, axis) { + var v = ( + this.data.z[b][a] + ); + + return (calendar === undefined) ? v : axis.d2l(v, 0, calendar); +}; + proto.handlePick = function(selection) { if(selection.object === this.surface) { - var selectIndex = selection.index = [ - Math.min( - Math.round(selection.data.index[0] / this.dataScale - 1)|0, - this.data.z[0].length - 1 - ), - Math.min( - Math.round(selection.data.index[1] / this.dataScale - 1)|0, - this.data.z.length - 1 - ) - ]; - var traceCoordinate = [0, 0, 0]; - if(!isArrayOrTypedArray(this.data.x)) { - traceCoordinate[0] = selectIndex[0]; - } else if(isArrayOrTypedArray(this.data.x[0])) { - traceCoordinate[0] = this.data.x[selectIndex[1]][selectIndex[0]]; - } else { - traceCoordinate[0] = this.data.x[selectIndex[0]]; - } + var xRatio = (selection.data.index[0] - 1) / this.dataScaleX - 1; + var yRatio = (selection.data.index[1] - 1) / this.dataScaleY - 1; - if(!isArrayOrTypedArray(this.data.y)) { - traceCoordinate[1] = selectIndex[1]; - } else if(isArrayOrTypedArray(this.data.y[0])) { - traceCoordinate[1] = this.data.y[selectIndex[1]][selectIndex[0]]; - } else { - traceCoordinate[1] = this.data.y[selectIndex[1]]; - } + var j = Math.max(Math.min(Math.round(xRatio), this.data.z[0].length - 1), 0); + var k = Math.max(Math.min(Math.round(yRatio), this.data._ylength - 1), 0); + + selection.index = [j, k]; - traceCoordinate[2] = this.data.z[selectIndex[1]][selectIndex[0]]; - selection.traceCoordinate = traceCoordinate; + selection.traceCoordinate = [ + this.getXat(j, k), + this.getYat(j, k), + this.getZat(j, k) + ]; - var sceneLayout = this.scene.fullSceneLayout; selection.dataCoordinate = [ - sceneLayout.xaxis.d2l(traceCoordinate[0], 0, this.data.xcalendar) * this.scene.dataScale[0], - sceneLayout.yaxis.d2l(traceCoordinate[1], 0, this.data.ycalendar) * this.scene.dataScale[1], - sceneLayout.zaxis.d2l(traceCoordinate[2], 0, this.data.zcalendar) * this.scene.dataScale[2] + this.getXat(j, k, this.data.xcalendar, this.scene.fullSceneLayout.xaxis), + this.getYat(j, k, this.data.ycalendar, this.scene.fullSceneLayout.yaxis), + this.getZat(j, k, this.data.zcalendar, this.scene.fullSceneLayout.zaxis) ]; + for(var i = 0; i < 3; i++) { + var v = selection.dataCoordinate[i]; + if(v !== null && v !== undefined) { + selection.dataCoordinate[i] *= this.scene.dataScale[i]; + } + } + var text = this.data.text; - if(Array.isArray(text) && text[selectIndex[1]] && text[selectIndex[1]][selectIndex[0]] !== undefined) { - selection.textLabel = text[selectIndex[1]][selectIndex[0]]; + if(Array.isArray(text) && text[k] && text[k][j] !== undefined) { + selection.textLabel = text[k][j]; } else if(text) { selection.textLabel = text; } else { @@ -104,59 +128,221 @@ function isColormapCircular(colormap) { ); } -// Pad coords by +1 -function padField(field) { - var shape = field.shape; - var nshape = [shape[0] + 2, shape[1] + 2]; - var nfield = ndarray(new Float32Array(nshape[0] * nshape[1]), nshape); - - // Center - ops.assign(nfield.lo(1, 1).hi(shape[0], shape[1]), field); - - // Edges - ops.assign(nfield.lo(1).hi(shape[0], 1), - field.hi(shape[0], 1)); - ops.assign(nfield.lo(1, nshape[1] - 1).hi(shape[0], 1), - field.lo(0, shape[1] - 1).hi(shape[0], 1)); - ops.assign(nfield.lo(0, 1).hi(1, shape[1]), - field.hi(1)); - ops.assign(nfield.lo(nshape[0] - 1, 1).hi(1, shape[1]), - field.lo(shape[0] - 1)); - - // Corners - nfield.set(0, 0, field.get(0, 0)); - nfield.set(0, nshape[1] - 1, field.get(0, shape[1] - 1)); - nfield.set(nshape[0] - 1, 0, field.get(shape[0] - 1, 0)); - nfield.set(nshape[0] - 1, nshape[1] - 1, field.get(shape[0] - 1, shape[1] - 1)); - - return nfield; +var shortPrimes = [ + 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, + 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, + 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, + 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, + 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, + 503, 509, 521, 523, 541, 547, 557, 563, 569, 571, 577, 587, 593, 599, + 601, 607, 613, 617, 619, 631, 641, 643, 647, 653, 659, 661, 673, 677, 683, 691, + 701, 709, 719, 727, 733, 739, 743, 751, 757, 761, 769, 773, 787, 797, + 809, 811, 821, 823, 827, 829, 839, 853, 857, 859, 863, 877, 881, 883, 887, + 907, 911, 919, 929, 937, 941, 947, 953, 967, 971, 977, 983, 991, 997, + 1009, 1013, 1019, 1021, 1031, 1033, 1039, 1049, 1051, 1061, 1063, 1069, 1087, 1091, 1093, 1097, + 1103, 1109, 1117, 1123, 1129, 1151, 1153, 1163, 1171, 1181, 1187, 1193, + 1201, 1213, 1217, 1223, 1229, 1231, 1237, 1249, 1259, 1277, 1279, 1283, 1289, 1291, 1297, + 1301, 1303, 1307, 1319, 1321, 1327, 1361, 1367, 1373, 1381, 1399, + 1409, 1423, 1427, 1429, 1433, 1439, 1447, 1451, 1453, 1459, 1471, 1481, 1483, 1487, 1489, 1493, 1499, + 1511, 1523, 1531, 1543, 1549, 1553, 1559, 1567, 1571, 1579, 1583, 1597, + 1601, 1607, 1609, 1613, 1619, 1621, 1627, 1637, 1657, 1663, 1667, 1669, 1693, 1697, 1699, + 1709, 1721, 1723, 1733, 1741, 1747, 1753, 1759, 1777, 1783, 1787, 1789, + 1801, 1811, 1823, 1831, 1847, 1861, 1867, 1871, 1873, 1877, 1879, 1889, + 1901, 1907, 1913, 1931, 1933, 1949, 1951, 1973, 1979, 1987, 1993, 1997, 1999, + 2003, 2011, 2017, 2027, 2029, 2039, 2053, 2063, 2069, 2081, 2083, 2087, 2089, 2099, + 2111, 2113, 2129, 2131, 2137, 2141, 2143, 2153, 2161, 2179, + 2203, 2207, 2213, 2221, 2237, 2239, 2243, 2251, 2267, 2269, 2273, 2281, 2287, 2293, 2297, + 2309, 2311, 2333, 2339, 2341, 2347, 2351, 2357, 2371, 2377, 2381, 2383, 2389, 2393, 2399, + 2411, 2417, 2423, 2437, 2441, 2447, 2459, 2467, 2473, 2477, + 2503, 2521, 2531, 2539, 2543, 2549, 2551, 2557, 2579, 2591, 2593, + 2609, 2617, 2621, 2633, 2647, 2657, 2659, 2663, 2671, 2677, 2683, 2687, 2689, 2693, 2699, + 2707, 2711, 2713, 2719, 2729, 2731, 2741, 2749, 2753, 2767, 2777, 2789, 2791, 2797, + 2801, 2803, 2819, 2833, 2837, 2843, 2851, 2857, 2861, 2879, 2887, 2897, + 2903, 2909, 2917, 2927, 2939, 2953, 2957, 2963, 2969, 2971, 2999 +]; + +function getPow(a, b) { + if(a < b) return 0; + var n = 0; + while(Math.floor(a % b) === 0) { + a /= b; + n++; + } + return n; +} + +function getFactors(a) { + var powers = []; + for(var i = 0; i < shortPrimes.length; i++) { + var b = shortPrimes[i]; + powers.push( + getPow(a, b) + ); + } + return powers; } -function refine(coords) { - var minScale = Math.max(coords[0].shape[0], coords[0].shape[1]); - - if(minScale < MIN_RESOLUTION) { - var scaleF = MIN_RESOLUTION / minScale; - var nshape = [ - Math.floor((coords[0].shape[0]) * scaleF + 1)|0, - Math.floor((coords[0].shape[1]) * scaleF + 1)|0 ]; - var nsize = nshape[0] * nshape[1]; - - for(var i = 0; i < coords.length; ++i) { - var padImg = padField(coords[i]); - var scaledImg = ndarray(new Float32Array(nsize), nshape); - homography(scaledImg, padImg, [scaleF, 0, 0, - 0, scaleF, 0, - 0, 0, 1]); - coords[i] = scaledImg; +function smallestDivisor(a) { + var A = getFactors(a); + var result = a; + for(var i = 0; i < shortPrimes.length; i++) { + if(A[i] > 0) { + result = shortPrimes[i]; + break; } + } + return result; +} - return scaleF; +function leastCommonMultiple(a, b) { + if(a < 1 || b < 1) return undefined; + var A = getFactors(a); + var B = getFactors(b); + var n = 1; + for(var i = 0; i < shortPrimes.length; i++) { + n *= Math.pow( + shortPrimes[i], Math.max(A[i], B[i]) + ); } + return n; +} - return 1.0; +function arrayLCM(A) { + if(A.length === 0) return undefined; + var n = 1; + for(var i = 0; i < A.length; i++) { + n = leastCommonMultiple(n, A[i]); + } + return n; } +proto.calcXnums = function(xlen) { + var i; + var nums = []; + for(i = 1; i < xlen; i++) { + var a = this.getXat(i - 1, 0); + var b = this.getXat(i, 0); + + if(b !== a && + a !== undefined && a !== null && + b !== undefined && b !== null) { + nums[i - 1] = Math.abs(b - a); + } else { + nums[i - 1] = 0; + } + } + + var totalDist = 0; + for(i = 1; i < xlen; i++) { + totalDist += nums[i - 1]; + } + + for(i = 1; i < xlen; i++) { + if(nums[i - 1] === 0) { + nums[i - 1] = 1; + } else { + nums[i - 1] = Math.round(totalDist / nums[i - 1]); + } + } + + return nums; +}; + +proto.calcYnums = function(ylen) { + var i; + var nums = []; + for(i = 1; i < ylen; i++) { + var a = this.getYat(0, i - 1); + var b = this.getYat(0, i); + + if(b !== a && + a !== undefined && a !== null && + b !== undefined && b !== null) { + nums[i - 1] = Math.abs(b - a); + } else { + nums[i - 1] = 0; + } + } + + var totalDist = 0; + for(i = 1; i < ylen; i++) { + totalDist += nums[i - 1]; + } + + for(i = 1; i < ylen; i++) { + if(nums[i - 1] === 0) { + nums[i - 1] = 1; + } else { + nums[i - 1] = Math.round(totalDist / nums[i - 1]); + } + } + + return nums; +}; + +var highlyComposites = [1, 2, 4, 6, 12, 24, 36, 48, 60, 120, 180, 240, 360, 720, 840, 1260]; + +var MIN_RESOLUTION = highlyComposites[9]; +var MAX_RESOLUTION = highlyComposites[13]; + +proto.estimateScale = function(resSrc, axis) { + var nums = (axis === 0) ? + this.calcXnums(resSrc) : + this.calcYnums(resSrc); + + var resDst = 1 + arrayLCM(nums); + + while(resDst < MIN_RESOLUTION) { + resDst *= 2; + } + + while(resDst > MAX_RESOLUTION) { + resDst--; + resDst /= smallestDivisor(resDst); + resDst++; + + if(resDst < MIN_RESOLUTION) { + // resDst = MIN_RESOLUTION; // option 1: use min resolution + resDst = MAX_RESOLUTION; // option 2: use max resolution + } + } + + var scale = Math.round(resDst / resSrc); + return (scale > 1) ? scale : 1; +}; + +proto.refineCoords = function(coords) { + + var scaleW = this.dataScaleX; + var scaleH = this.dataScaleY; + + var width = coords[0].shape[0]; + var height = coords[0].shape[1]; + + var newWidth = Math.floor(coords[0].shape[0] * scaleW + 1) | 0; + var newHeight = Math.floor(coords[0].shape[1] * scaleH + 1) | 0; + + // Pad coords by +1 + var padWidth = 1 + width + 1; + var padHeight = 1 + height + 1; + var padImg = ndarray(new Float32Array(padWidth * padHeight), [padWidth, padHeight]); + + for(var i = 0; i < coords.length; ++i) { + + this.surface.padField(padImg, coords[i]); + + var scaledImg = ndarray(new Float32Array(newWidth * newHeight), [newWidth, newHeight]); + homography(scaledImg, padImg, + [ + scaleW, 0, 0, + 0, scaleH, 0, + 0, 0, 1 + ] + ); + coords[i] = scaledImg; + } +}; + proto.setContourLevels = function() { var nlevels = [[], [], []]; var needsUpdate = false; @@ -174,28 +360,14 @@ proto.setContourLevels = function() { }; proto.update = function(data) { - var i, - scene = this.scene, + var scene = this.scene, sceneLayout = scene.fullSceneLayout, surface = this.surface, alpha = data.opacity, colormap = parseColorScale(data.colorscale, alpha), - z = data.z, - x = data.x, - y = data.y, - xaxis = sceneLayout.xaxis, - yaxis = sceneLayout.yaxis, - zaxis = sceneLayout.zaxis, scaleFactor = scene.dataScale, - xlen = z[0].length, + xlen = data.z[0].length, ylen = data._ylength, - coords = [ - ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), - ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), - ndarray(new Float32Array(xlen * ylen), [xlen, ylen]) - ], - xc = coords[0], - yc = coords[1], contourLevels = scene.contourLevels; // Save data @@ -209,46 +381,87 @@ proto.update = function(data) { * which is the transpose of 'gl-surface-plot'. */ - var xcalendar = data.xcalendar, - ycalendar = data.ycalendar, - zcalendar = data.zcalendar; + var i, j, k, v; + var rawCoords = []; + for(i = 0; i < 3; i++) { + rawCoords[i] = []; + for(j = 0; j < xlen; j++) { + rawCoords[i][j] = []; + /* + for(k = 0; k < ylen; k++) { + rawCoords[i][j][k] = undefined; + } + */ + } + } + + // coords x, y & z + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + rawCoords[0][j][k] = this.getXat(j, k, data.xcalendar, sceneLayout.xaxis); + rawCoords[1][j][k] = this.getYat(j, k, data.ycalendar, sceneLayout.yaxis); + rawCoords[2][j][k] = this.getZat(j, k, data.zcalendar, sceneLayout.zaxis); + } + } - fill(coords[2], function(row, col) { - return zaxis.d2l(z[col][row], 0, zcalendar) * scaleFactor[2]; - }); + // Note: log axes are not defined in surfaces yet. + // but they could be defined here... + + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v === null || v === undefined) { + rawCoords[i][j][k] = NaN; + } else { + v = rawCoords[i][j][k] *= scaleFactor[i]; + } + } + } + } - // coords x - if(!isArrayOrTypedArray(x)) { - fill(xc, function(row) { - return xaxis.d2l(row, 0, xcalendar) * scaleFactor[0]; - }); - } else if(isArrayOrTypedArray(x[0])) { - fill(xc, function(row, col) { - return xaxis.d2l(x[col][row], 0, xcalendar) * scaleFactor[0]; - }); - } else { - // ticks x - fill(xc, function(row) { - return xaxis.d2l(x[row], 0, xcalendar) * scaleFactor[0]; - }); + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v !== null && v !== undefined) { + if(this.minValues[i] > v) { + this.minValues[i] = v; + } + if(this.maxValues[i] < v) { + this.maxValues[i] = v; + } + } + } + } } - // coords y - if(!isArrayOrTypedArray(x)) { - fill(yc, function(row, col) { - return yaxis.d2l(col, 0, xcalendar) * scaleFactor[1]; - }); - } else if(isArrayOrTypedArray(y[0])) { - fill(yc, function(row, col) { - return yaxis.d2l(y[col][row], 0, ycalendar) * scaleFactor[1]; - }); - } else { - // ticks y - fill(yc, function(row, col) { - return yaxis.d2l(y[col], 0, ycalendar) * scaleFactor[1]; - }); + for(i = 0; i < 3; i++) { + data._objectOffset[i] = 0.5 * (this.minValues[i] + this.maxValues[i]); } + for(i = 0; i < 3; i++) { + for(j = 0; j < xlen; j++) { + for(k = 0; k < ylen; k++) { + v = rawCoords[i][j][k]; + if(v !== null && v !== undefined) { + rawCoords[i][j][k] -= data._objectOffset[i]; + } + } + } + } + + // convert processed raw data to Float32 matrices + var coords = [ + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]), + ndarray(new Float32Array(xlen * ylen), [xlen, ylen]) + ]; + fill(coords[0], function(row, col) { return rawCoords[0][row][col]; }); + fill(coords[1], function(row, col) { return rawCoords[1][row][col]; }); + fill(coords[2], function(row, col) { return rawCoords[2][row][col]; }); + rawCoords = []; // free memory + var params = { colormap: colormap, levels: [[], [], []], @@ -270,7 +483,7 @@ proto.update = function(data) { params.intensityBounds = [data.cmin, data.cmax]; - // Refine if necessary + // Refine surface color if necessary if(data.surfacecolor) { var intensity = ndarray(new Float32Array(xlen * ylen), [xlen, ylen]); @@ -287,7 +500,18 @@ proto.update = function(data) { params.intensityBounds[1] *= scaleFactor[2]; } - this.dataScale = refine(coords); + if(MAX_RESOLUTION < coords[0].shape[0] || + MAX_RESOLUTION < coords[0].shape[1]) { + this.refineData = false; + } + + if(this.refineData === true) { + this.dataScaleX = this.estimateScale(coords[0].shape[0], 0); + this.dataScaleY = this.estimateScale(coords[0].shape[1], 1); + if(this.dataScaleX !== 1 || this.dataScaleY !== 1) { + this.refineCoords(coords); + } + } if(data.surfacecolor) { params.intensity = coords.pop(); @@ -336,8 +560,13 @@ proto.update = function(data) { params.vertexColor = true; } - params.coords = coords; + params.objectOffset = [ + data._objectOffset[0], + data._objectOffset[1], + data._objectOffset[2] + ]; + params.coords = coords; surface.update(params); surface.visible = data.visible; diff --git a/src/traces/surface/defaults.js b/src/traces/surface/defaults.js index b7493f91ccb..8c1307f5bf3 100644 --- a/src/traces/surface/defaults.js +++ b/src/traces/surface/defaults.js @@ -35,6 +35,8 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout traceOut._xlength = (Array.isArray(x) && Lib.isArrayOrTypedArray(x[0])) ? z.length : z[0].length; traceOut._ylength = z.length; + traceOut._objectOffset = [0, 0, 0]; + var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults'); handleCalendarDefaults(traceIn, traceOut, ['x', 'y', 'z'], layout); diff --git a/test/image/baselines/gl3d_autocolorscale.png b/test/image/baselines/gl3d_autocolorscale.png index 93aa63787c3..54c28165987 100644 Binary files a/test/image/baselines/gl3d_autocolorscale.png and b/test/image/baselines/gl3d_autocolorscale.png differ diff --git a/test/image/baselines/gl3d_autorange-zero.png b/test/image/baselines/gl3d_autorange-zero.png index b63b4c8bade..c7ee927e779 100644 Binary files a/test/image/baselines/gl3d_autorange-zero.png and b/test/image/baselines/gl3d_autorange-zero.png differ diff --git a/test/image/baselines/gl3d_contour-lines.png b/test/image/baselines/gl3d_contour-lines.png index 80046026ee1..c57477c1990 100644 Binary files a/test/image/baselines/gl3d_contour-lines.png and b/test/image/baselines/gl3d_contour-lines.png differ diff --git a/test/image/baselines/gl3d_contour-lines2.png b/test/image/baselines/gl3d_contour-lines2.png index 83539e49013..5b08c87586c 100644 Binary files a/test/image/baselines/gl3d_contour-lines2.png and b/test/image/baselines/gl3d_contour-lines2.png differ diff --git a/test/image/baselines/gl3d_cufflinks.png b/test/image/baselines/gl3d_cufflinks.png index 6c223398bfa..ff65c51d464 100644 Binary files a/test/image/baselines/gl3d_cufflinks.png and b/test/image/baselines/gl3d_cufflinks.png differ diff --git a/test/image/baselines/gl3d_ibm-plot.png b/test/image/baselines/gl3d_ibm-plot.png index fa9bd9f11a2..796d36a6ec6 100644 Binary files a/test/image/baselines/gl3d_ibm-plot.png and b/test/image/baselines/gl3d_ibm-plot.png differ diff --git a/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png b/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png index a5df09af1ad..2be771f972f 100644 Binary files a/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png and b/test/image/baselines/gl3d_mesh3d_surface3d_scatter3d_line3d_error3d_log_reversed_ranges.png differ diff --git a/test/image/baselines/gl3d_nan-holes.png b/test/image/baselines/gl3d_nan-holes.png index 365fc8bfc8e..5e051cb846c 100644 Binary files a/test/image/baselines/gl3d_nan-holes.png and b/test/image/baselines/gl3d_nan-holes.png differ diff --git a/test/image/baselines/gl3d_opacity-surface.png b/test/image/baselines/gl3d_opacity-surface.png index ad89c289b21..c3a6a6a6d7f 100644 Binary files a/test/image/baselines/gl3d_opacity-surface.png and b/test/image/baselines/gl3d_opacity-surface.png differ diff --git a/test/image/baselines/gl3d_parametric_surface_data_precision.png b/test/image/baselines/gl3d_parametric_surface_data_precision.png new file mode 100644 index 00000000000..59b5d34d8db Binary files /dev/null and b/test/image/baselines/gl3d_parametric_surface_data_precision.png differ diff --git a/test/image/baselines/gl3d_perspective_tick_distances.png b/test/image/baselines/gl3d_perspective_tick_distances.png index 7c007c341f8..53cb757ffe9 100644 Binary files a/test/image/baselines/gl3d_perspective_tick_distances.png and b/test/image/baselines/gl3d_perspective_tick_distances.png differ diff --git a/test/image/baselines/gl3d_ribbons.png b/test/image/baselines/gl3d_ribbons.png index 4df4b107a71..0309f7c7ccc 100644 Binary files a/test/image/baselines/gl3d_ribbons.png and b/test/image/baselines/gl3d_ribbons.png differ diff --git a/test/image/baselines/gl3d_surface-circular-colorscale.png b/test/image/baselines/gl3d_surface-circular-colorscale.png index d1ccfd9a0a6..6680d2ea64c 100644 Binary files a/test/image/baselines/gl3d_surface-circular-colorscale.png and b/test/image/baselines/gl3d_surface-circular-colorscale.png differ diff --git a/test/image/baselines/gl3d_surface-lighting.png b/test/image/baselines/gl3d_surface-lighting.png index 3c809941d9c..debc99f875d 100644 Binary files a/test/image/baselines/gl3d_surface-lighting.png and b/test/image/baselines/gl3d_surface-lighting.png differ diff --git a/test/image/baselines/gl3d_surface_contour_precision.png b/test/image/baselines/gl3d_surface_contour_precision.png new file mode 100644 index 00000000000..16d07fb49b4 Binary files /dev/null and b/test/image/baselines/gl3d_surface_contour_precision.png differ diff --git a/test/image/baselines/gl3d_world-cals.png b/test/image/baselines/gl3d_world-cals.png index ce1bb9e24c5..f2d8cdf21ec 100644 Binary files a/test/image/baselines/gl3d_world-cals.png and b/test/image/baselines/gl3d_world-cals.png differ diff --git a/test/image/baselines/gl3d_xy-defined-ticks.png b/test/image/baselines/gl3d_xy-defined-ticks.png index 544cf849925..939ca54fdef 100644 Binary files a/test/image/baselines/gl3d_xy-defined-ticks.png and b/test/image/baselines/gl3d_xy-defined-ticks.png differ diff --git a/test/image/mocks/gl3d_ibm-plot.json b/test/image/mocks/gl3d_ibm-plot.json index 35fab40ae43..166e16463e4 100644 --- a/test/image/mocks/gl3d_ibm-plot.json +++ b/test/image/mocks/gl3d_ibm-plot.json @@ -196,21 +196,6 @@ 20.0538, 17.7003, 15.4519 - ], - [ - 31.7202, - 28.0013, - 25.1881, - 24.006999999999998, - 23.4612, - 23.1983, - 22.9418, - 22.6914, - 22.4469, - 21.9752, - 21.1062, - 18.9972, - 16.6826 ] ], "x": [ diff --git a/test/image/mocks/gl3d_parametric_surface_data_precision.json b/test/image/mocks/gl3d_parametric_surface_data_precision.json new file mode 100644 index 00000000000..ecf17cb32e7 --- /dev/null +++ b/test/image/mocks/gl3d_parametric_surface_data_precision.json @@ -0,0 +1,104 @@ +{ + "data": [ + { + "type": "surface", + "contours": {"x": {"show": true}, "y": {"show": true}, "z": {"show": false}}, + "x": [ + [0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000], + [0.201,0.198,0.190,0.178,0.161,0.142,0.121,0.100,0.080,0.064,0.051,0.043,0.040,0.043,0.051,0.064,0.080,0.100,0.121,0.142,0.161,0.178,0.190,0.198,0.201], + [0.361,0.356,0.342,0.319,0.289,0.254,0.217,0.179,0.144,0.114,0.092,0.077,0.072,0.077,0.092,0.114,0.144,0.179,0.217,0.254,0.289,0.319,0.342,0.356,0.361], + [0.442,0.436,0.418,0.390,0.354,0.311,0.265,0.219,0.177,0.140,0.112,0.094,0.088,0.094,0.112,0.140,0.177,0.219,0.265,0.311,0.354,0.390,0.418,0.436,0.442], + [0.417,0.411,0.394,0.368,0.333,0.293,0.250,0.207,0.167,0.132,0.106,0.089,0.083,0.089,0.106,0.132,0.167,0.207,0.250,0.293,0.333,0.368,0.394,0.411,0.417], + [0.270,0.266,0.255,0.238,0.216,0.190,0.162,0.134,0.108,0.086,0.068,0.058,0.054,0.058,0.068,0.086,0.108,0.134,0.162,0.190,0.216,0.238,0.255,0.266,0.270], + [0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000], + [-0.377,-0.372,-0.357,-0.333,-0.302,-0.266,-0.226,-0.187,-0.151,-0.120,-0.096,-0.081,-0.075,-0.081,-0.096,-0.120,-0.151,-0.187,-0.226,-0.266,-0.302,-0.333,-0.357,-0.372,-0.377], + [-0.833,-0.822,-0.789,-0.736,-0.667,-0.586,-0.500,-0.414,-0.333,-0.264,-0.211,-0.178,-0.167,-0.178,-0.211,-0.264,-0.333,-0.414,-0.500,-0.586,-0.667,-0.736,-0.789,-0.822,-0.833], + [-1.326,-1.308,-1.255,-1.170,-1.061,-0.933,-0.795,-0.658,-0.530,-0.420,-0.336,-0.283,-0.265,-0.283,-0.336,-0.420,-0.530,-0.658,-0.795,-0.933,-1.061,-1.170,-1.255,-1.308,-1.326], + [-1.804,-1.780,-1.708,-1.593,-1.443,-1.269,-1.083,-0.896,-0.722,-0.572,-0.458,-0.385,-0.361,-0.385,-0.458,-0.572,-0.722,-0.896,-1.083,-1.269,-1.443,-1.593,-1.708,-1.780,-1.804], + [-2.214,-2.183,-2.095,-1.954,-1.771,-1.557,-1.328,-1.099,-0.885,-0.702,-0.561,-0.473,-0.443,-0.473,-0.561,-0.702,-0.885,-1.099,-1.328,-1.557,-1.771,-1.954,-2.095,-2.183,-2.214], + [-2.500,-2.466,-2.366,-2.207,-2.000,-1.759,-1.500,-1.241,-1.000,-0.793,-0.634,-0.534,-0.500,-0.534,-0.634,-0.793,-1.000,-1.241,-1.500,-1.759,-2.000,-2.207,-2.366,-2.466,-2.500], + [-2.616,-2.580,-2.476,-2.310,-2.093,-1.840,-1.570,-1.299,-1.046,-0.830,-0.663,-0.559,-0.523,-0.559,-0.663,-0.830,-1.046,-1.299,-1.570,-1.840,-2.093,-2.310,-2.476,-2.580,-2.616], + [-2.526,-2.491,-2.391,-2.230,-2.021,-1.777,-1.516,-1.254,-1.010,-0.801,-0.641,-0.540,-0.505,-0.540,-0.641,-0.801,-1.010,-1.254,-1.516,-1.777,-2.021,-2.230,-2.391,-2.491,-2.526], + [-2.210,-2.180,-2.091,-1.951,-1.768,-1.555,-1.326,-1.097,-0.884,-0.701,-0.560,-0.472,-0.442,-0.472,-0.560,-0.701,-0.884,-1.097,-1.326,-1.555,-1.768,-1.951,-2.091,-2.180,-2.210], + [-1.667,-1.644,-1.577,-1.471,-1.333,-1.173,-1.000,-0.827,-0.667,-0.529,-0.423,-0.356,-0.333,-0.356,-0.423,-0.529,-0.667,-0.827,-1.000,-1.173,-1.333,-1.471,-1.577,-1.644,-1.667], + [-0.917,-0.904,-0.868,-0.809,-0.733,-0.645,-0.550,-0.455,-0.367,-0.291,-0.232,-0.196,-0.183,-0.196,-0.232,-0.291,-0.367,-0.455,-0.550,-0.645,-0.733,-0.809,-0.868,-0.904,-0.917], + [-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000], + [1.024,1.011,0.970,0.904,0.820,0.721,0.615,0.509,0.410,0.325,0.260,0.219,0.205,0.219,0.260,0.325,0.410,0.509,0.615,0.721,0.820,0.904,0.970,1.011,1.024], + [2.083,2.055,1.972,1.839,1.667,1.466,1.250,1.034,0.833,0.661,0.528,0.445,0.417,0.445,0.528,0.661,0.833,1.034,1.250,1.466,1.667,1.839,1.972,2.055,2.083], + [3.094,3.051,2.928,2.731,2.475,2.176,1.856,1.536,1.237,0.981,0.785,0.661,0.619,0.661,0.785,0.981,1.237,1.536,1.856,2.176,2.475,2.731,2.928,3.051,3.094], + [3.969,3.915,3.757,3.504,3.175,2.793,2.382,1.971,1.588,1.259,1.007,0.848,0.794,0.848,1.007,1.259,1.588,1.971,2.382,2.793,3.175,3.504,3.757,3.915,3.969], + [4.628,4.565,4.380,4.086,3.703,3.256,2.777,2.298,1.851,1.468,1.174,0.989,0.926,0.989,1.174,1.468,1.851,2.298,2.777,3.256,3.703,4.086,4.380,4.565,4.628], + [5.000,4.932,4.732,4.414,4.000,3.518,3.000,2.482,2.000,1.586,1.268,1.068,1.000,1.068,1.268,1.586,2.000,2.482,3.000,3.518,4.000,4.414,4.732,4.932,5.000] + ], + "y": [ + [0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000], + [0.054,0.053,0.051,0.048,0.043,0.038,0.032,0.027,0.022,0.017,0.014,0.012,0.011,0.012,0.014,0.017,0.022,0.027,0.032,0.038,0.043,0.048,0.051,0.053,0.054], + [0.208,0.205,0.197,0.184,0.167,0.147,0.125,0.103,0.083,0.066,0.053,0.045,0.042,0.045,0.053,0.066,0.083,0.103,0.125,0.147,0.167,0.184,0.197,0.205,0.208], + [0.442,0.436,0.418,0.390,0.354,0.311,0.265,0.219,0.177,0.140,0.112,0.094,0.088,0.094,0.112,0.140,0.177,0.219,0.265,0.311,0.354,0.390,0.418,0.436,0.442], + [0.722,0.712,0.683,0.637,0.577,0.508,0.433,0.358,0.289,0.229,0.183,0.154,0.144,0.154,0.183,0.229,0.289,0.358,0.433,0.508,0.577,0.637,0.683,0.712,0.722], + [1.006,0.992,0.952,0.888,0.805,0.708,0.604,0.500,0.402,0.319,0.255,0.215,0.201,0.215,0.255,0.319,0.402,0.500,0.604,0.708,0.805,0.888,0.952,0.992,1.006], + [1.250,1.233,1.183,1.104,1.000,0.879,0.750,0.621,0.500,0.396,0.317,0.267,0.250,0.267,0.317,0.396,0.500,0.621,0.750,0.879,1.000,1.104,1.183,1.233,1.250], + [1.409,1.389,1.333,1.244,1.127,0.991,0.845,0.699,0.563,0.447,0.357,0.301,0.282,0.301,0.357,0.447,0.563,0.699,0.845,0.991,1.127,1.244,1.333,1.389,1.409], + [1.443,1.424,1.366,1.274,1.155,1.015,0.866,0.717,0.577,0.458,0.366,0.308,0.289,0.308,0.366,0.458,0.577,0.717,0.866,1.015,1.155,1.274,1.366,1.424,1.443], + [1.326,1.308,1.255,1.170,1.061,0.933,0.795,0.658,0.530,0.420,0.336,0.283,0.265,0.283,0.336,0.420,0.530,0.658,0.795,0.933,1.061,1.170,1.255,1.308,1.326], + [1.042,1.027,0.986,0.920,0.833,0.733,0.625,0.517,0.417,0.330,0.264,0.223,0.208,0.223,0.264,0.330,0.417,0.517,0.625,0.733,0.833,0.920,0.986,1.027,1.042], + [0.593,0.585,0.561,0.524,0.475,0.417,0.356,0.294,0.237,0.188,0.150,0.127,0.119,0.127,0.150,0.188,0.237,0.294,0.356,0.417,0.475,0.524,0.561,0.585,0.593], + [0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000,0.000], + [-0.701,-0.691,-0.663,-0.619,-0.561,-0.493,-0.421,-0.348,-0.280,-0.222,-0.178,-0.150,-0.140,-0.150,-0.178,-0.222,-0.280,-0.348,-0.421,-0.493,-0.561,-0.619,-0.663,-0.691,-0.701], + [-1.458,-1.438,-1.380,-1.287,-1.167,-1.026,-0.875,-0.724,-0.583,-0.463,-0.370,-0.312,-0.292,-0.312,-0.370,-0.463,-0.583,-0.724,-0.875,-1.026,-1.167,-1.287,-1.380,-1.438,-1.458], + [-2.210,-2.180,-2.091,-1.951,-1.768,-1.555,-1.326,-1.097,-0.884,-0.701,-0.560,-0.472,-0.442,-0.472,-0.560,-0.701,-0.884,-1.097,-1.326,-1.555,-1.768,-1.951,-2.091,-2.180,-2.210], + [-2.887,-2.847,-2.732,-2.549,-2.309,-2.031,-1.732,-1.433,-1.155,-0.916,-0.732,-0.617,-0.577,-0.617,-0.732,-0.916,-1.155,-1.433,-1.732,-2.031,-2.309,-2.549,-2.732,-2.847,-2.887], + [-3.421,-3.374,-3.238,-3.020,-2.737,-2.407,-2.053,-1.698,-1.368,-1.085,-0.868,-0.731,-0.684,-0.731,-0.868,-1.085,-1.368,-1.698,-2.053,-2.407,-2.737,-3.020,-3.238,-3.374,-3.421], + [-3.750,-3.699,-3.549,-3.311,-3.000,-2.638,-2.250,-1.862,-1.500,-1.189,-0.951,-0.801,-0.750,-0.801,-0.951,-1.189,-1.500,-1.862,-2.250,-2.638,-3.000,-3.311,-3.549,-3.699,-3.750], + [-3.823,-3.771,-3.619,-3.376,-3.059,-2.690,-2.294,-1.898,-1.529,-1.213,-0.970,-0.817,-0.765,-0.817,-0.970,-1.213,-1.529,-1.898,-2.294,-2.690,-3.059,-3.376,-3.619,-3.771,-3.823], + [-3.608,-3.559,-3.415,-3.186,-2.887,-2.539,-2.165,-1.791,-1.443,-1.144,-0.915,-0.771,-0.722,-0.771,-0.915,-1.144,-1.443,-1.791,-2.165,-2.539,-2.887,-3.186,-3.415,-3.559,-3.608], + [-3.094,-3.051,-2.928,-2.731,-2.475,-2.176,-1.856,-1.536,-1.237,-0.981,-0.785,-0.661,-0.619,-0.661,-0.785,-0.981,-1.237,-1.536,-1.856,-2.176,-2.475,-2.731,-2.928,-3.051,-3.094], + [-2.292,-2.260,-2.169,-2.023,-1.833,-1.612,-1.375,-1.138,-0.917,-0.727,-0.581,-0.490,-0.458,-0.490,-0.581,-0.727,-0.917,-1.138,-1.375,-1.612,-1.833,-2.023,-2.169,-2.260,-2.292], + [-1.240,-1.223,-1.174,-1.095,-0.992,-0.872,-0.744,-0.616,-0.496,-0.393,-0.314,-0.265,-0.248,-0.265,-0.314,-0.393,-0.496,-0.616,-0.744,-0.872,-0.992,-1.095,-1.174,-1.223,-1.240], + [-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000,-0.000] + ], + "z": [ + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000], + [54321.000,54321.259,54321.500,54321.707,54321.866,54321.966,54322.000,54321.966,54321.866,54321.707,54321.500,54321.259,54321.000,54320.741,54320.500,54320.293,54320.134,54320.034,54320.000,54320.034,54320.134,54320.293,54320.500,54320.741,54321.000] + ] + } + ], + "layout": { + "title": "Parametric surface using 2D input arrays and data precision limits", + "width": 800, + "height": 600, + "scene": { + "xaxis": {"nticks": 24}, + "yaxis": {"nticks": 24}, + "zaxis": {"nticks": 4}, + "camera": { + "eye": {"x": 1.25, "y": 1.25, "z": 1.25}, + "center": {"x": 0, "y": 0, "z": 0}, + "up": {"x": 0, "y": 0, "z": 1} + } + } + } +} diff --git a/test/image/mocks/gl3d_surface_contour_precision.json b/test/image/mocks/gl3d_surface_contour_precision.json new file mode 100644 index 00000000000..d9eb4508ee3 --- /dev/null +++ b/test/image/mocks/gl3d_surface_contour_precision.json @@ -0,0 +1,41 @@ +{ + "data": [ + { + "type": "surface", + "contours": {"x": {"show": false}, "y": {"show": false}, "z": {"show": true}}, + "x": [0, 0.1485, 0.5, 0.9090, 1], + "y": [0, 0.5, 1], + "z": [ + [54321.9876, 54322.9876, 54321.9876, 54322.9876, 54321.9876], + [54322.9876, 54321.9876, 54322.9876, 54321.9876, 54322.9876], + [54321.9876, 54322.9876, 54321.9876, 54322.9876, 54321.9876] + ] + }, + { + "type": "surface", + "contours": {"x": {"show": false}, "y": {"show": false}, "z": {"show": true}}, + "x": [0, 0.1485, 0.5, 0.9090, 1], + "y": [0, 0.5, 1], + "z": [ + [54323.9876, 54322.9876, 54323.9876, 54322.9876, 54323.9876], + [54322.9876, 54323.9876, 54322.9876, 54323.9876, 54322.9876], + [54323.9876, 54322.9876, 54323.9876, 54322.9876, 54323.9876] + ] + } + ], + "layout": { + "title": "Big numbers and surface contour precision", + "width": 800, + "height": 600, + "scene": { + "xaxis": {"nticks": 4}, + "yaxis": {"nticks": 4}, + "zaxis": {"nticks": 48}, + "camera": { + "eye": {"x": 1, "y": 1, "z": 0}, + "center": {"x": 0, "y": 0, "z": 0}, + "up": {"x": 0, "y": 0, "z": 1} + } + } + } +}