From fa4426f4313fa8dd28b9cda8c411b2e7c36b3683 Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 12:29:42 +0200 Subject: [PATCH 1/7] [BUGFIX] fix Cannot read property 'document' of undefined When plotly.js is loaded in Chrome by the native ES6 import, the loading crashes with Cannot read property 'document' of undefined The problem is that the bundler assumes that when a function is executed without any this, the this will automatically be set to window. This is not the case with ES6 modules, where this will be undefined. --- dist/plotly.js | 5700 ++++++++++++++++++++++++------------------------ 1 file changed, 2850 insertions(+), 2850 deletions(-) diff --git a/dist/plotly.js b/dist/plotly.js index 441db1e80a7..e4f49766155 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -4997,74 +4997,74 @@ function alphaShape(alpha, points) { return bnd(ac(alpha, points)) } },{"alpha-complex":63,"simplicial-complex-boundary":517}],65:[function(_dereq_,module,exports){ -'use strict' - -module.exports = normalize; - -function normalize (arr, dim) { - if (!arr || arr.length == null) throw Error('Argument should be an array') - - if (dim == null) dim = 1 - else dim = Math.floor(dim) - - var bounds = Array(dim * 2) - - for (var offset = 0; offset < dim; offset++) { - var max = -Infinity, min = Infinity, i = offset, l = arr.length; - - for (; i < l; i+=dim) { - if (arr[i] > max) max = arr[i]; - if (arr[i] < min) min = arr[i]; - } - - bounds[offset] = min - bounds[dim + offset] = max - } - - return bounds; -} +'use strict' + +module.exports = normalize; + +function normalize (arr, dim) { + if (!arr || arr.length == null) throw Error('Argument should be an array') + + if (dim == null) dim = 1 + else dim = Math.floor(dim) + + var bounds = Array(dim * 2) + + for (var offset = 0; offset < dim; offset++) { + var max = -Infinity, min = Infinity, i = offset, l = arr.length; + + for (; i < l; i+=dim) { + if (arr[i] > max) max = arr[i]; + if (arr[i] < min) min = arr[i]; + } + + bounds[offset] = min + bounds[dim + offset] = max + } + + return bounds; +} },{}],66:[function(_dereq_,module,exports){ -'use strict' - -var getBounds = _dereq_('array-bounds') - -module.exports = normalize; - -function normalize (arr, dim, bounds) { - if (!arr || arr.length == null) throw Error('Argument should be an array') - - if (dim == null) dim = 1 - if (bounds == null) bounds = getBounds(arr, dim) - - for (var offset = 0; offset < dim; offset++) { - var max = bounds[dim + offset], min = bounds[offset], i = offset, l = arr.length; - - if (max === Infinity && min === -Infinity) { - for (i = offset; i < l; i+=dim) { - arr[i] = arr[i] === max ? 1 : arr[i] === min ? 0 : .5 - } - } - else if (max === Infinity) { - for (i = offset; i < l; i+=dim) { - arr[i] = arr[i] === max ? 1 : 0 - } - } - else if (min === -Infinity) { - for (i = offset; i < l; i+=dim) { - arr[i] = arr[i] === min ? 0 : 1 - } - } - else { - var range = max - min - for (i = offset; i < l; i+=dim) { - arr[i] = range === 0 ? .5 : (arr[i] - min) / range - } - } - } - - return arr; -} +'use strict' + +var getBounds = _dereq_('array-bounds') + +module.exports = normalize; + +function normalize (arr, dim, bounds) { + if (!arr || arr.length == null) throw Error('Argument should be an array') + + if (dim == null) dim = 1 + if (bounds == null) bounds = getBounds(arr, dim) + + for (var offset = 0; offset < dim; offset++) { + var max = bounds[dim + offset], min = bounds[offset], i = offset, l = arr.length; + + if (max === Infinity && min === -Infinity) { + for (i = offset; i < l; i+=dim) { + arr[i] = arr[i] === max ? 1 : arr[i] === min ? 0 : .5 + } + } + else if (max === Infinity) { + for (i = offset; i < l; i+=dim) { + arr[i] = arr[i] === max ? 1 : 0 + } + } + else if (min === -Infinity) { + for (i = offset; i < l; i+=dim) { + arr[i] = arr[i] === min ? 0 : 1 + } + } + else { + var range = max - min + for (i = offset; i < l; i+=dim) { + arr[i] = range === 0 ? .5 : (arr[i] - min) / range + } + } + } + + return arr; +} },{"array-bounds":65}],67:[function(_dereq_,module,exports){ @@ -7001,142 +7001,142 @@ exports.nextCombination = function(v) { },{}],93:[function(_dereq_,module,exports){ -'use strict' - -var clamp = _dereq_('clamp') - -module.exports = calcSDF - -var INF = 1e20; - -function calcSDF(src, options) { - if (!options) options = {} - - var cutoff = options.cutoff == null ? 0.25 : options.cutoff - var radius = options.radius == null ? 8 : options.radius - var channel = options.channel || 0 - var w, h, size, data, intData, stride, ctx, canvas, imgData, i, l - - // handle image container - if (ArrayBuffer.isView(src) || Array.isArray(src)) { - if (!options.width || !options.height) throw Error('For raw data width and height should be provided by options') - w = options.width, h = options.height - data = src - - if (!options.stride) stride = Math.floor(src.length / w / h) - else stride = options.stride - } - else { - if (window.HTMLCanvasElement && src instanceof window.HTMLCanvasElement) { - canvas = src - ctx = canvas.getContext('2d') - w = canvas.width, h = canvas.height - imgData = ctx.getImageData(0, 0, w, h) - data = imgData.data - stride = 4 - } - else if (window.CanvasRenderingContext2D && src instanceof window.CanvasRenderingContext2D) { - canvas = src.canvas - ctx = src - w = canvas.width, h = canvas.height - imgData = ctx.getImageData(0, 0, w, h) - data = imgData.data - stride = 4 - } - else if (window.ImageData && src instanceof window.ImageData) { - imgData = src - w = src.width, h = src.height - data = imgData.data - stride = 4 - } - } - - size = Math.max(w, h) - - //convert int data to floats - if ((window.Uint8ClampedArray && data instanceof window.Uint8ClampedArray) || (window.Uint8Array && data instanceof window.Uint8Array)) { - intData = data - data = Array(w*h) - - for (i = 0, l = intData.length; i < l; i++) { - data[i] = intData[i*stride + channel] / 255 - } - } - else { - if (stride !== 1) throw Error('Raw data can have only 1 value per pixel') - } - - // temporary arrays for the distance transform - var gridOuter = Array(w * h) - var gridInner = Array(w * h) - var f = Array(size) - var d = Array(size) - var z = Array(size + 1) - var v = Array(size) - - for (i = 0, l = w * h; i < l; i++) { - var a = data[i] - gridOuter[i] = a === 1 ? 0 : a === 0 ? INF : Math.pow(Math.max(0, 0.5 - a), 2) - gridInner[i] = a === 1 ? INF : a === 0 ? 0 : Math.pow(Math.max(0, a - 0.5), 2) - } - - edt(gridOuter, w, h, f, d, v, z) - edt(gridInner, w, h, f, d, v, z) - - var dist = window.Float32Array ? new Float32Array(w * h) : new Array(w * h) - - for (i = 0, l = w*h; i < l; i++) { - dist[i] = clamp(1 - ( (gridOuter[i] - gridInner[i]) / radius + cutoff), 0, 1) - } - - return dist -} - -// 2D Euclidean distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/dt/ -function edt(data, width, height, f, d, v, z) { - for (var x = 0; x < width; x++) { - for (var y = 0; y < height; y++) { - f[y] = data[y * width + x] - } - edt1d(f, d, v, z, height) - for (y = 0; y < height; y++) { - data[y * width + x] = d[y] - } - } - for (y = 0; y < height; y++) { - for (x = 0; x < width; x++) { - f[x] = data[y * width + x] - } - edt1d(f, d, v, z, width) - for (x = 0; x < width; x++) { - data[y * width + x] = Math.sqrt(d[x]) - } - } -} - -// 1D squared distance transform -function edt1d(f, d, v, z, n) { - v[0] = 0; - z[0] = -INF - z[1] = +INF - - for (var q = 1, k = 0; q < n; q++) { - var s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k]) - while (s <= z[k]) { - k-- - s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k]) - } - k++ - v[k] = q - z[k] = s - z[k + 1] = +INF - } - - for (q = 0, k = 0; q < n; q++) { - while (z[k + 1] < q) k++ - d[q] = (q - v[k]) * (q - v[k]) + f[v[k]] - } -} +'use strict' + +var clamp = _dereq_('clamp') + +module.exports = calcSDF + +var INF = 1e20; + +function calcSDF(src, options) { + if (!options) options = {} + + var cutoff = options.cutoff == null ? 0.25 : options.cutoff + var radius = options.radius == null ? 8 : options.radius + var channel = options.channel || 0 + var w, h, size, data, intData, stride, ctx, canvas, imgData, i, l + + // handle image container + if (ArrayBuffer.isView(src) || Array.isArray(src)) { + if (!options.width || !options.height) throw Error('For raw data width and height should be provided by options') + w = options.width, h = options.height + data = src + + if (!options.stride) stride = Math.floor(src.length / w / h) + else stride = options.stride + } + else { + if (window.HTMLCanvasElement && src instanceof window.HTMLCanvasElement) { + canvas = src + ctx = canvas.getContext('2d') + w = canvas.width, h = canvas.height + imgData = ctx.getImageData(0, 0, w, h) + data = imgData.data + stride = 4 + } + else if (window.CanvasRenderingContext2D && src instanceof window.CanvasRenderingContext2D) { + canvas = src.canvas + ctx = src + w = canvas.width, h = canvas.height + imgData = ctx.getImageData(0, 0, w, h) + data = imgData.data + stride = 4 + } + else if (window.ImageData && src instanceof window.ImageData) { + imgData = src + w = src.width, h = src.height + data = imgData.data + stride = 4 + } + } + + size = Math.max(w, h) + + //convert int data to floats + if ((window.Uint8ClampedArray && data instanceof window.Uint8ClampedArray) || (window.Uint8Array && data instanceof window.Uint8Array)) { + intData = data + data = Array(w*h) + + for (i = 0, l = intData.length; i < l; i++) { + data[i] = intData[i*stride + channel] / 255 + } + } + else { + if (stride !== 1) throw Error('Raw data can have only 1 value per pixel') + } + + // temporary arrays for the distance transform + var gridOuter = Array(w * h) + var gridInner = Array(w * h) + var f = Array(size) + var d = Array(size) + var z = Array(size + 1) + var v = Array(size) + + for (i = 0, l = w * h; i < l; i++) { + var a = data[i] + gridOuter[i] = a === 1 ? 0 : a === 0 ? INF : Math.pow(Math.max(0, 0.5 - a), 2) + gridInner[i] = a === 1 ? INF : a === 0 ? 0 : Math.pow(Math.max(0, a - 0.5), 2) + } + + edt(gridOuter, w, h, f, d, v, z) + edt(gridInner, w, h, f, d, v, z) + + var dist = window.Float32Array ? new Float32Array(w * h) : new Array(w * h) + + for (i = 0, l = w*h; i < l; i++) { + dist[i] = clamp(1 - ( (gridOuter[i] - gridInner[i]) / radius + cutoff), 0, 1) + } + + return dist +} + +// 2D Euclidean distance transform by Felzenszwalb & Huttenlocher https://cs.brown.edu/~pff/dt/ +function edt(data, width, height, f, d, v, z) { + for (var x = 0; x < width; x++) { + for (var y = 0; y < height; y++) { + f[y] = data[y * width + x] + } + edt1d(f, d, v, z, height) + for (y = 0; y < height; y++) { + data[y * width + x] = d[y] + } + } + for (y = 0; y < height; y++) { + for (x = 0; x < width; x++) { + f[x] = data[y * width + x] + } + edt1d(f, d, v, z, width) + for (x = 0; x < width; x++) { + data[y * width + x] = Math.sqrt(d[x]) + } + } +} + +// 1D squared distance transform +function edt1d(f, d, v, z, n) { + v[0] = 0; + z[0] = -INF + z[1] = +INF + + for (var q = 1, k = 0; q < n; q++) { + var s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k]) + while (s <= z[k]) { + k-- + s = ((f[q] + q * q) - (f[v[k]] + v[k] * v[k])) / (2 * q - 2 * v[k]) + } + k++ + v[k] = q + z[k] = s + z[k + 1] = +INF + } + + for (q = 0, k = 0; q < n; q++) { + while (z[k + 1] < q) k++ + d[q] = (q - v[k]) * (q - v[k]) + f[v[k]] + } +} },{"clamp":115}],94:[function(_dereq_,module,exports){ (function (module, exports) { @@ -15798,280 +15798,280 @@ function solveIntersection (a, b, c, d) { } },{"big-rat/div":77,"big-rat/mul":87,"big-rat/sign":88,"big-rat/sub":89,"rat-vec/add":485,"rat-vec/muls":487,"rat-vec/sub":488}],118:[function(_dereq_,module,exports){ -/** @module color-id */ - -'use strict' - -var clamp = _dereq_('clamp') - -module.exports = toNumber -module.exports.to = toNumber -module.exports.from = fromNumber - -function toNumber (rgba, normalized) { - if(normalized == null) normalized = true - - var r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3] - - if (a == null) a = normalized ? 1 : 255 - - if (normalized) { - r *= 255 - g *= 255 - b *= 255 - a *= 255 - } - - r = clamp(r, 0, 255) & 0xFF - g = clamp(g, 0, 255) & 0xFF - b = clamp(b, 0, 255) & 0xFF - a = clamp(a, 0, 255) & 0xFF - - //hi-order shift converts to -1, so we can't use <<24 - var n = (r * 0x01000000) + (g << 16) + (b << 8) + (a) - - return n -} - -function fromNumber (n, normalized) { - n = +n - - var r = n >>> 24 - var g = (n & 0x00ff0000) >>> 16 - var b = (n & 0x0000ff00) >>> 8 - var a = n & 0x000000ff - - if (normalized === false) return [r, g, b, a] - - return [r/255, g/255, b/255, a/255] -} +/** @module color-id */ + +'use strict' + +var clamp = _dereq_('clamp') + +module.exports = toNumber +module.exports.to = toNumber +module.exports.from = fromNumber + +function toNumber (rgba, normalized) { + if(normalized == null) normalized = true + + var r = rgba[0], g = rgba[1], b = rgba[2], a = rgba[3] + + if (a == null) a = normalized ? 1 : 255 + + if (normalized) { + r *= 255 + g *= 255 + b *= 255 + a *= 255 + } + + r = clamp(r, 0, 255) & 0xFF + g = clamp(g, 0, 255) & 0xFF + b = clamp(b, 0, 255) & 0xFF + a = clamp(a, 0, 255) & 0xFF + + //hi-order shift converts to -1, so we can't use <<24 + var n = (r * 0x01000000) + (g << 16) + (b << 8) + (a) + + return n +} + +function fromNumber (n, normalized) { + n = +n + + var r = n >>> 24 + var g = (n & 0x00ff0000) >>> 16 + var b = (n & 0x0000ff00) >>> 8 + var a = n & 0x000000ff + + if (normalized === false) return [r, g, b, a] + + return [r/255, g/255, b/255, a/255] +} },{"clamp":115}],119:[function(_dereq_,module,exports){ -'use strict' - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; +'use strict' + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; },{}],120:[function(_dereq_,module,exports){ -/** @module color-normalize */ - -'use strict' - -var rgba = _dereq_('color-rgba') -var clamp = _dereq_('clamp') -var dtype = _dereq_('dtype') - -module.exports = function normalize (color, type) { - if (type === 'float' || !type) type = 'array' - if (type === 'uint') type = 'uint8' - if (type === 'uint_clamped') type = 'uint8_clamped' - var Ctor = dtype(type) - var output = new Ctor(4) - - var normalize = type !== 'uint8' && type !== 'uint8_clamped' - - // attempt to parse non-array arguments - if (!color.length || typeof color === 'string') { - color = rgba(color) - color[0] /= 255 - color[1] /= 255 - color[2] /= 255 - } - - // 0, 1 are possible contradictory values for Arrays: - // [1,1,1] input gives [1,1,1] output instead of [1/255,1/255,1/255], which may be collision if input is meant to be uint. - // converting [1,1,1] to [1/255,1/255,1/255] in case of float input gives larger mistake since [1,1,1] float is frequent edge value, whereas [0,1,1], [1,1,1] etc. uint inputs are relatively rare - if (isInt(color)) { - output[0] = color[0] - output[1] = color[1] - output[2] = color[2] - output[3] = color[3] != null ? color[3] : 255 - - if (normalize) { - output[0] /= 255 - output[1] /= 255 - output[2] /= 255 - output[3] /= 255 - } - - return output - } - - if (!normalize) { - output[0] = clamp(Math.floor(color[0] * 255), 0, 255) - output[1] = clamp(Math.floor(color[1] * 255), 0, 255) - output[2] = clamp(Math.floor(color[2] * 255), 0, 255) - output[3] = color[3] == null ? 255 : clamp(Math.floor(color[3] * 255), 0, 255) - } else { - output[0] = color[0] - output[1] = color[1] - output[2] = color[2] - output[3] = color[3] != null ? color[3] : 1 - } - - return output -} - -function isInt(color) { - if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) return true - - if (Array.isArray(color) && - (color[0] > 1 || color[0] === 0) && - (color[1] > 1 || color[1] === 0) && - (color[2] > 1 || color[2] === 0) && - (!color[3] || color[3] > 1) - ) return true - - return false -} +/** @module color-normalize */ + +'use strict' + +var rgba = _dereq_('color-rgba') +var clamp = _dereq_('clamp') +var dtype = _dereq_('dtype') + +module.exports = function normalize (color, type) { + if (type === 'float' || !type) type = 'array' + if (type === 'uint') type = 'uint8' + if (type === 'uint_clamped') type = 'uint8_clamped' + var Ctor = dtype(type) + var output = new Ctor(4) + + var normalize = type !== 'uint8' && type !== 'uint8_clamped' + + // attempt to parse non-array arguments + if (!color.length || typeof color === 'string') { + color = rgba(color) + color[0] /= 255 + color[1] /= 255 + color[2] /= 255 + } + + // 0, 1 are possible contradictory values for Arrays: + // [1,1,1] input gives [1,1,1] output instead of [1/255,1/255,1/255], which may be collision if input is meant to be uint. + // converting [1,1,1] to [1/255,1/255,1/255] in case of float input gives larger mistake since [1,1,1] float is frequent edge value, whereas [0,1,1], [1,1,1] etc. uint inputs are relatively rare + if (isInt(color)) { + output[0] = color[0] + output[1] = color[1] + output[2] = color[2] + output[3] = color[3] != null ? color[3] : 255 + + if (normalize) { + output[0] /= 255 + output[1] /= 255 + output[2] /= 255 + output[3] /= 255 + } + + return output + } + + if (!normalize) { + output[0] = clamp(Math.floor(color[0] * 255), 0, 255) + output[1] = clamp(Math.floor(color[1] * 255), 0, 255) + output[2] = clamp(Math.floor(color[2] * 255), 0, 255) + output[3] = color[3] == null ? 255 : clamp(Math.floor(color[3] * 255), 0, 255) + } else { + output[0] = color[0] + output[1] = color[1] + output[2] = color[2] + output[3] = color[3] != null ? color[3] : 1 + } + + return output +} + +function isInt(color) { + if (color instanceof Uint8Array || color instanceof Uint8ClampedArray) return true + + if (Array.isArray(color) && + (color[0] > 1 || color[0] === 0) && + (color[1] > 1 || color[1] === 0) && + (color[2] > 1 || color[2] === 0) && + (!color[3] || color[3] > 1) + ) return true + + return false +} },{"clamp":115,"color-rgba":122,"dtype":169}],121:[function(_dereq_,module,exports){ (function (global){ @@ -17194,305 +17194,305 @@ module.exports = { } },{}],135:[function(_dereq_,module,exports){ -module.exports=[ - "xx-small", - "x-small", - "small", - "medium", - "large", - "x-large", - "xx-large", - "larger", - "smaller" -] +module.exports=[ + "xx-small", + "x-small", + "small", + "medium", + "large", + "x-large", + "xx-large", + "larger", + "smaller" +] },{}],136:[function(_dereq_,module,exports){ -module.exports=[ - "normal", - "condensed", - "semi-condensed", - "extra-condensed", - "ultra-condensed", - "expanded", - "semi-expanded", - "extra-expanded", - "ultra-expanded" -] +module.exports=[ + "normal", + "condensed", + "semi-condensed", + "extra-condensed", + "ultra-condensed", + "expanded", + "semi-expanded", + "extra-expanded", + "ultra-expanded" +] },{}],137:[function(_dereq_,module,exports){ -module.exports=[ - "normal", - "italic", - "oblique" -] +module.exports=[ + "normal", + "italic", + "oblique" +] },{}],138:[function(_dereq_,module,exports){ -module.exports=[ - "normal", - "bold", - "bolder", - "lighter", - "100", - "200", - "300", - "400", - "500", - "600", - "700", - "800", - "900" -] +module.exports=[ + "normal", + "bold", + "bolder", + "lighter", + "100", + "200", + "300", + "400", + "500", + "600", + "700", + "800", + "900" +] },{}],139:[function(_dereq_,module,exports){ -'use strict' - -module.exports = { - parse: _dereq_('./parse'), - stringify: _dereq_('./stringify') -} +'use strict' + +module.exports = { + parse: _dereq_('./parse'), + stringify: _dereq_('./stringify') +} },{"./parse":141,"./stringify":142}],140:[function(_dereq_,module,exports){ -'use strict' - -var sizes = _dereq_('css-font-size-keywords') - -module.exports = { - isSize: function isSize(value) { - return /^[\d\.]/.test(value) - || value.indexOf('/') !== -1 - || sizes.indexOf(value) !== -1 - } -} +'use strict' + +var sizes = _dereq_('css-font-size-keywords') + +module.exports = { + isSize: function isSize(value) { + return /^[\d\.]/.test(value) + || value.indexOf('/') !== -1 + || sizes.indexOf(value) !== -1 + } +} },{"css-font-size-keywords":135}],141:[function(_dereq_,module,exports){ -'use strict' - -var unquote = _dereq_('unquote') -var globalKeywords = _dereq_('css-global-keywords') -var systemFontKeywords = _dereq_('css-system-font-keywords') -var fontWeightKeywords = _dereq_('css-font-weight-keywords') -var fontStyleKeywords = _dereq_('css-font-style-keywords') -var fontStretchKeywords = _dereq_('css-font-stretch-keywords') -var splitBy = _dereq_('string-split-by') -var isSize = _dereq_('./lib/util').isSize - - -module.exports = parseFont - - -var cache = parseFont.cache = {} - - -function parseFont (value) { - if (typeof value !== 'string') throw new Error('Font argument must be a string.') - - if (cache[value]) return cache[value] - - if (value === '') { - throw new Error('Cannot parse an empty string.') - } - - if (systemFontKeywords.indexOf(value) !== -1) { - return cache[value] = {system: value} - } - - var font = { - style: 'normal', - variant: 'normal', - weight: 'normal', - stretch: 'normal', - lineHeight: 'normal', - size: '1rem', - family: ['serif'] - } - - var tokens = splitBy(value, /\s+/) - var token - - while (token = tokens.shift()) { - if (globalKeywords.indexOf(token) !== -1) { - ['style', 'variant', 'weight', 'stretch'].forEach(function(prop) { - font[prop] = token - }) - - return cache[value] = font - } - - if (fontStyleKeywords.indexOf(token) !== -1) { - font.style = token - continue - } - - if (token === 'normal' || token === 'small-caps') { - font.variant = token - continue - } - - if (fontStretchKeywords.indexOf(token) !== -1) { - font.stretch = token - continue - } - - if (fontWeightKeywords.indexOf(token) !== -1) { - font.weight = token - continue - } - - - if (isSize(token)) { - var parts = splitBy(token, '/') - font.size = parts[0] - if (parts[1] != null) { - font.lineHeight = parseLineHeight(parts[1]) - } - else if (tokens[0] === '/') { - tokens.shift() - font.lineHeight = parseLineHeight(tokens.shift()) - } - - if (!tokens.length) { - throw new Error('Missing required font-family.') - } - font.family = splitBy(tokens.join(' '), /\s*,\s*/).map(unquote) - - return cache[value] = font - } - - throw new Error('Unknown or unsupported font token: ' + token) - } - - throw new Error('Missing required font-size.') -} - - -function parseLineHeight(value) { - var parsed = parseFloat(value) - if (parsed.toString() === value) { - return parsed - } - return value -} +'use strict' + +var unquote = _dereq_('unquote') +var globalKeywords = _dereq_('css-global-keywords') +var systemFontKeywords = _dereq_('css-system-font-keywords') +var fontWeightKeywords = _dereq_('css-font-weight-keywords') +var fontStyleKeywords = _dereq_('css-font-style-keywords') +var fontStretchKeywords = _dereq_('css-font-stretch-keywords') +var splitBy = _dereq_('string-split-by') +var isSize = _dereq_('./lib/util').isSize + + +module.exports = parseFont + + +var cache = parseFont.cache = {} + + +function parseFont (value) { + if (typeof value !== 'string') throw new Error('Font argument must be a string.') + + if (cache[value]) return cache[value] + + if (value === '') { + throw new Error('Cannot parse an empty string.') + } + + if (systemFontKeywords.indexOf(value) !== -1) { + return cache[value] = {system: value} + } + + var font = { + style: 'normal', + variant: 'normal', + weight: 'normal', + stretch: 'normal', + lineHeight: 'normal', + size: '1rem', + family: ['serif'] + } + + var tokens = splitBy(value, /\s+/) + var token + + while (token = tokens.shift()) { + if (globalKeywords.indexOf(token) !== -1) { + ['style', 'variant', 'weight', 'stretch'].forEach(function(prop) { + font[prop] = token + }) + + return cache[value] = font + } + + if (fontStyleKeywords.indexOf(token) !== -1) { + font.style = token + continue + } + + if (token === 'normal' || token === 'small-caps') { + font.variant = token + continue + } + + if (fontStretchKeywords.indexOf(token) !== -1) { + font.stretch = token + continue + } + + if (fontWeightKeywords.indexOf(token) !== -1) { + font.weight = token + continue + } + + + if (isSize(token)) { + var parts = splitBy(token, '/') + font.size = parts[0] + if (parts[1] != null) { + font.lineHeight = parseLineHeight(parts[1]) + } + else if (tokens[0] === '/') { + tokens.shift() + font.lineHeight = parseLineHeight(tokens.shift()) + } + + if (!tokens.length) { + throw new Error('Missing required font-family.') + } + font.family = splitBy(tokens.join(' '), /\s*,\s*/).map(unquote) + + return cache[value] = font + } + + throw new Error('Unknown or unsupported font token: ' + token) + } + + throw new Error('Missing required font-size.') +} + + +function parseLineHeight(value) { + var parsed = parseFloat(value) + if (parsed.toString() === value) { + return parsed + } + return value +} },{"./lib/util":140,"css-font-stretch-keywords":136,"css-font-style-keywords":137,"css-font-weight-keywords":138,"css-global-keywords":143,"css-system-font-keywords":144,"string-split-by":529,"unquote":548}],142:[function(_dereq_,module,exports){ -'use strict' - -var pick = _dereq_('pick-by-alias') -var isSize = _dereq_('./lib/util').isSize - -var globals = a2o(_dereq_('css-global-keywords')) -var systems = a2o(_dereq_('css-system-font-keywords')) -var weights = a2o(_dereq_('css-font-weight-keywords')) -var styles = a2o(_dereq_('css-font-style-keywords')) -var stretches = a2o(_dereq_('css-font-stretch-keywords')) - -var variants = {'normal': 1, 'small-caps': 1} -var fams = { - 'serif': 1, - 'sans-serif': 1, - 'monospace': 1, - 'cursive': 1, - 'fantasy': 1, - 'system-ui': 1 -} - -var defaults = { - style: 'normal', - variant: 'normal', - weight: 'normal', - stretch: 'normal', - size: '1rem', - lineHeight: 'normal', - family: 'serif' -} - -module.exports = function stringifyFont (o) { - o = pick(o, { - style: 'style fontstyle fontStyle font-style slope distinction', - variant: 'variant font-variant fontVariant fontvariant var capitalization', - weight: 'weight w font-weight fontWeight fontweight', - stretch: 'stretch font-stretch fontStretch fontstretch width', - size: 'size s font-size fontSize fontsize height em emSize', - lineHeight: 'lh line-height lineHeight lineheight leading', - family: 'font family fontFamily font-family fontfamily type typeface face', - system: 'system reserved default global', - }) - - if (o.system) { - if (o.system) verify(o.system, systems) - return o.system - } - - verify(o.style, styles) - verify(o.variant, variants) - verify(o.weight, weights) - verify(o.stretch, stretches) - - // default root value is medium, but by default it's inherited - if (o.size == null) o.size = defaults.size - if (typeof o.size === 'number') o.size += 'px' - - if (!isSize) throw Error('Bad size value `' + o.size + '`') - - // many user-agents use serif, we don't detect that for consistency - if (!o.family) o.family = defaults.family - if (Array.isArray(o.family)) { - if (!o.family.length) o.family = [defaults.family] - o.family = o.family.map(function (f) { - return fams[f] ? f : '"' + f + '"' - }).join(', ') - } - - // [ [ <'font-style'> || || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] - var result = [] - - result.push(o.style) - if (o.variant !== o.style) result.push(o.variant) - - if (o.weight !== o.variant && - o.weight !== o.style) result.push(o.weight) - - if (o.stretch !== o.weight && - o.stretch !== o.variant && - o.stretch !== o.style) result.push(o.stretch) - - result.push(o.size + (o.lineHeight == null || o.lineHeight === 'normal' || (o.lineHeight + '' === '1') ? '' : ('/' + o.lineHeight))) - result.push(o.family) - - return result.filter(Boolean).join(' ') -} - -function verify (value, values) { - if (value && !values[value] && !globals[value]) throw Error('Unknown keyword `' + value +'`') - - return value -} - - -// ['a', 'b'] -> {a: true, b: true} -function a2o (a) { - var o = {} - for (var i = 0; i < a.length; i++) { - o[a[i]] = 1 - } - return o -} +'use strict' + +var pick = _dereq_('pick-by-alias') +var isSize = _dereq_('./lib/util').isSize + +var globals = a2o(_dereq_('css-global-keywords')) +var systems = a2o(_dereq_('css-system-font-keywords')) +var weights = a2o(_dereq_('css-font-weight-keywords')) +var styles = a2o(_dereq_('css-font-style-keywords')) +var stretches = a2o(_dereq_('css-font-stretch-keywords')) + +var variants = {'normal': 1, 'small-caps': 1} +var fams = { + 'serif': 1, + 'sans-serif': 1, + 'monospace': 1, + 'cursive': 1, + 'fantasy': 1, + 'system-ui': 1 +} + +var defaults = { + style: 'normal', + variant: 'normal', + weight: 'normal', + stretch: 'normal', + size: '1rem', + lineHeight: 'normal', + family: 'serif' +} + +module.exports = function stringifyFont (o) { + o = pick(o, { + style: 'style fontstyle fontStyle font-style slope distinction', + variant: 'variant font-variant fontVariant fontvariant var capitalization', + weight: 'weight w font-weight fontWeight fontweight', + stretch: 'stretch font-stretch fontStretch fontstretch width', + size: 'size s font-size fontSize fontsize height em emSize', + lineHeight: 'lh line-height lineHeight lineheight leading', + family: 'font family fontFamily font-family fontfamily type typeface face', + system: 'system reserved default global', + }) + + if (o.system) { + if (o.system) verify(o.system, systems) + return o.system + } + + verify(o.style, styles) + verify(o.variant, variants) + verify(o.weight, weights) + verify(o.stretch, stretches) + + // default root value is medium, but by default it's inherited + if (o.size == null) o.size = defaults.size + if (typeof o.size === 'number') o.size += 'px' + + if (!isSize) throw Error('Bad size value `' + o.size + '`') + + // many user-agents use serif, we don't detect that for consistency + if (!o.family) o.family = defaults.family + if (Array.isArray(o.family)) { + if (!o.family.length) o.family = [defaults.family] + o.family = o.family.map(function (f) { + return fams[f] ? f : '"' + f + '"' + }).join(', ') + } + + // [ [ <'font-style'> || || <'font-weight'> || <'font-stretch'> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'> ] + var result = [] + + result.push(o.style) + if (o.variant !== o.style) result.push(o.variant) + + if (o.weight !== o.variant && + o.weight !== o.style) result.push(o.weight) + + if (o.stretch !== o.weight && + o.stretch !== o.variant && + o.stretch !== o.style) result.push(o.stretch) + + result.push(o.size + (o.lineHeight == null || o.lineHeight === 'normal' || (o.lineHeight + '' === '1') ? '' : ('/' + o.lineHeight))) + result.push(o.family) + + return result.filter(Boolean).join(' ') +} + +function verify (value, values) { + if (value && !values[value] && !globals[value]) throw Error('Unknown keyword `' + value +'`') + + return value +} + + +// ['a', 'b'] -> {a: true, b: true} +function a2o (a) { + var o = {} + for (var i = 0; i < a.length; i++) { + o[a[i]] = 1 + } + return o +} },{"./lib/util":140,"css-font-stretch-keywords":136,"css-font-style-keywords":137,"css-font-weight-keywords":138,"css-global-keywords":143,"css-system-font-keywords":144,"pick-by-alias":465}],143:[function(_dereq_,module,exports){ -module.exports=[ - "inherit", - "initial", - "unset" -] +module.exports=[ + "inherit", + "initial", + "unset" +] },{}],144:[function(_dereq_,module,exports){ -module.exports=[ - "caption", - "icon", - "menu", - "message-box", - "small-caption", - "status-bar" -] +module.exports=[ + "caption", + "icon", + "menu", + "message-box", + "small-caption", + "status-bar" +] },{}],145:[function(_dereq_,module,exports){ "use strict" @@ -34417,7 +34417,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return request.responseXML; }); if (typeof define === "function" && define.amd) this.d3 = d3, define(d3); else if (typeof module === "object" && module.exports) module.exports = d3; else this.d3 = d3; -}(); +}.apply(self); },{}],164:[function(_dereq_,module,exports){ module.exports = function () { for (var i = 0; i < arguments.length; i++) { @@ -34586,74 +34586,74 @@ function triangulate(points, includePointAtInfinity) { return hull } },{"incremental-convex-hull":413,"uniq":547}],166:[function(_dereq_,module,exports){ -'use strict' - - -module.exports = kerning - - -var canvas = kerning.canvas = document.createElement('canvas') -var ctx = canvas.getContext('2d') -var asciiPairs = createPairs([32, 126]) - -kerning.createPairs = createPairs -kerning.ascii = asciiPairs - - -function kerning (family, o) { - if (Array.isArray(family)) family = family.join(', ') - - var table = {}, pairs, fs = 16, threshold = .05 - - if (o) { - if (o.length === 2 && typeof o[0] === 'number') { - pairs = createPairs(o) - } - else if (Array.isArray(o)) { - pairs = o - } - else { - if (o.o) pairs = createPairs(o.o) - else if (o.pairs) pairs = o.pairs - - if (o.fontSize) fs = o.fontSize - if (o.threshold != null) threshold = o.threshold - } - } - - if (!pairs) pairs = asciiPairs - - ctx.font = fs + 'px ' + family - - for (var i = 0; i < pairs.length; i++) { - var pair = pairs[i] - var width = ctx.measureText(pair[0]).width + ctx.measureText(pair[1]).width - var kerningWidth = ctx.measureText(pair).width - if (Math.abs(width - kerningWidth) > fs * threshold) { - var emWidth = (kerningWidth - width) / fs - table[pair] = emWidth * 1000 - } - } - - return table -} - - -function createPairs (range) { - var pairs = [] - - for (var i = range[0]; i <= range[1]; i++) { - var leftChar = String.fromCharCode(i) - for (var j = range[0]; j < range[1]; j++) { - var rightChar = String.fromCharCode(j) - var pair = leftChar + rightChar - - pairs.push(pair) - } - } - - return pairs -} +'use strict' + + +module.exports = kerning + + +var canvas = kerning.canvas = document.createElement('canvas') +var ctx = canvas.getContext('2d') +var asciiPairs = createPairs([32, 126]) + +kerning.createPairs = createPairs +kerning.ascii = asciiPairs + + +function kerning (family, o) { + if (Array.isArray(family)) family = family.join(', ') + + var table = {}, pairs, fs = 16, threshold = .05 + + if (o) { + if (o.length === 2 && typeof o[0] === 'number') { + pairs = createPairs(o) + } + else if (Array.isArray(o)) { + pairs = o + } + else { + if (o.o) pairs = createPairs(o.o) + else if (o.pairs) pairs = o.pairs + + if (o.fontSize) fs = o.fontSize + if (o.threshold != null) threshold = o.threshold + } + } + + if (!pairs) pairs = asciiPairs + + ctx.font = fs + 'px ' + family + + for (var i = 0; i < pairs.length; i++) { + var pair = pairs[i] + var width = ctx.measureText(pair[0]).width + ctx.measureText(pair[1]).width + var kerningWidth = ctx.measureText(pair).width + if (Math.abs(width - kerningWidth) > fs * threshold) { + var emWidth = (kerningWidth - width) / fs + table[pair] = emWidth * 1000 + } + } + + return table +} + + +function createPairs (range) { + var pairs = [] + + for (var i = range[0]; i <= range[1]; i++) { + var leftChar = String.fromCharCode(i) + for (var j = range[0]; j < range[1]; j++) { + var rightChar = String.fromCharCode(j) + var pair = leftChar + rightChar + + pairs.push(pair) + } + } + + return pairs +} },{}],167:[function(_dereq_,module,exports){ (function (Buffer){ @@ -37707,250 +37707,250 @@ function flattenVertexData (data, output, offset) { } },{"dtype":169}],228:[function(_dereq_,module,exports){ -'use strict' - -var stringifyFont = _dereq_('css-font/stringify') -var defaultChars = [32, 126] - -module.exports = atlas - -function atlas(options) { - options = options || {} - - var shape = options.shape ? options.shape : options.canvas ? [options.canvas.width, options.canvas.height] : [512, 512] - var canvas = options.canvas || document.createElement('canvas') - var font = options.font - var step = typeof options.step === 'number' ? [options.step, options.step] : options.step || [32, 32] - var chars = options.chars || defaultChars - - if (font && typeof font !== 'string') font = stringifyFont(font) - - if (!Array.isArray(chars)) { - chars = String(chars).split('') - } else - if (chars.length === 2 - && typeof chars[0] === 'number' - && typeof chars[1] === 'number' - ) { - var newchars = [] - - for (var i = chars[0], j = 0; i <= chars[1]; i++) { - newchars[j++] = String.fromCharCode(i) - } - - chars = newchars - } - - shape = shape.slice() - canvas.width = shape[0] - canvas.height = shape[1] - - var ctx = canvas.getContext('2d') - - ctx.fillStyle = '#000' - ctx.fillRect(0, 0, canvas.width, canvas.height) - - ctx.font = font - ctx.textAlign = 'center' - ctx.textBaseline = 'middle' - ctx.fillStyle = '#fff' - - var x = step[0] / 2 - var y = step[1] / 2 - for (var i = 0; i < chars.length; i++) { - ctx.fillText(chars[i], x, y) - if ((x += step[0]) > shape[0] - step[0]/2) (x = step[0]/2), (y += step[1]) - } - - return canvas -} +'use strict' + +var stringifyFont = _dereq_('css-font/stringify') +var defaultChars = [32, 126] + +module.exports = atlas + +function atlas(options) { + options = options || {} + + var shape = options.shape ? options.shape : options.canvas ? [options.canvas.width, options.canvas.height] : [512, 512] + var canvas = options.canvas || document.createElement('canvas') + var font = options.font + var step = typeof options.step === 'number' ? [options.step, options.step] : options.step || [32, 32] + var chars = options.chars || defaultChars + + if (font && typeof font !== 'string') font = stringifyFont(font) + + if (!Array.isArray(chars)) { + chars = String(chars).split('') + } else + if (chars.length === 2 + && typeof chars[0] === 'number' + && typeof chars[1] === 'number' + ) { + var newchars = [] + + for (var i = chars[0], j = 0; i <= chars[1]; i++) { + newchars[j++] = String.fromCharCode(i) + } + + chars = newchars + } + + shape = shape.slice() + canvas.width = shape[0] + canvas.height = shape[1] + + var ctx = canvas.getContext('2d') + + ctx.fillStyle = '#000' + ctx.fillRect(0, 0, canvas.width, canvas.height) + + ctx.font = font + ctx.textAlign = 'center' + ctx.textBaseline = 'middle' + ctx.fillStyle = '#fff' + + var x = step[0] / 2 + var y = step[1] / 2 + for (var i = 0; i < chars.length; i++) { + ctx.fillText(chars[i], x, y) + if ((x += step[0]) > shape[0] - step[0]/2) (x = step[0]/2), (y += step[1]) + } + + return canvas +} },{"css-font/stringify":142}],229:[function(_dereq_,module,exports){ -'use strict' - -module.exports = measure - -measure.canvas = document.createElement('canvas') -measure.cache = {} - -function measure (font, o) { - if (!o) o = {} - - if (typeof font === 'string' || Array.isArray(font)) { - o.family = font - } - - var family = Array.isArray(o.family) ? o.family.join(', ') : o.family - if (!family) throw Error('`family` must be defined') - - var fs = o.size || o.fontSize || o.em || 48 - var weight = o.weight || o.fontWeight || '' - var style = o.style || o.fontStyle || '' - var font = [style, weight, fs].join(' ') + 'px ' + family - var origin = o.origin || 'top' - - if (measure.cache[family]) { - // return more precise values if cache has them - if (fs <= measure.cache[family].em) { - return applyOrigin(measure.cache[family], origin) - } - } - - var canvas = o.canvas || measure.canvas - var ctx = canvas.getContext('2d') - var chars = { - upper: o.upper !== undefined ? o.upper : 'H', - lower: o.lower !== undefined ? o.lower : 'x', - descent: o.descent !== undefined ? o.descent : 'p', - ascent: o.ascent !== undefined ? o.ascent : 'h', - tittle: o.tittle !== undefined ? o.tittle : 'i', - overshoot: o.overshoot !== undefined ? o.overshoot : 'O' - } - var l = Math.ceil(fs * 1.5) - canvas.height = l - canvas.width = l * .5 - ctx.font = font - - var char = 'H' - var result = { - top: 0 - } - - // measure line-height - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillStyle = 'black' - ctx.fillText(char, 0, 0) - var topPx = firstTop(ctx.getImageData(0, 0, l, l)) - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'bottom' - ctx.fillText(char, 0, l) - var bottomPx = firstTop(ctx.getImageData(0, 0, l, l)) - result.lineHeight = - result.bottom = l - bottomPx + topPx - - // measure baseline - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'alphabetic' - ctx.fillText(char, 0, l) - var baselinePx = firstTop(ctx.getImageData(0, 0, l, l)) - var baseline = l - baselinePx - 1 + topPx - result.baseline = - result.alphabetic = baseline - - // measure median - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'middle' - ctx.fillText(char, 0, l * .5) - var medianPx = firstTop(ctx.getImageData(0, 0, l, l)) - result.median = - result.middle = l - medianPx - 1 + topPx - l * .5 - - // measure hanging - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'hanging' - ctx.fillText(char, 0, l * .5) - var hangingPx = firstTop(ctx.getImageData(0, 0, l, l)) - result.hanging = l - hangingPx - 1 + topPx - l * .5 - - // measure ideographic - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'ideographic' - ctx.fillText(char, 0, l) - var ideographicPx = firstTop(ctx.getImageData(0, 0, l, l)) - result.ideographic = l - ideographicPx - 1 + topPx - - // measure cap - if (chars.upper) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.upper, 0, 0) - result.upper = firstTop(ctx.getImageData(0, 0, l, l)) - result.capHeight = (result.baseline - result.upper) - } - - // measure x - if (chars.lower) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.lower, 0, 0) - result.lower = firstTop(ctx.getImageData(0, 0, l, l)) - result.xHeight = (result.baseline - result.lower) - } - - // measure tittle - if (chars.tittle) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.tittle, 0, 0) - result.tittle = firstTop(ctx.getImageData(0, 0, l, l)) - } - - // measure ascent - if (chars.ascent) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.ascent, 0, 0) - result.ascent = firstTop(ctx.getImageData(0, 0, l, l)) - } - - // measure descent - if (chars.descent) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.descent, 0, 0) - result.descent = firstBottom(ctx.getImageData(0, 0, l, l)) - } - - // measure overshoot - if (chars.overshoot) { - ctx.clearRect(0, 0, l, l) - ctx.textBaseline = 'top' - ctx.fillText(chars.overshoot, 0, 0) - var overshootPx = firstBottom(ctx.getImageData(0, 0, l, l)) - result.overshoot = overshootPx - baseline - } - - // normalize result - for (var name in result) { - result[name] /= fs - } - - result.em = fs - measure.cache[family] = result - - return applyOrigin(result, origin) -} - -function applyOrigin(obj, origin) { - var res = {} - if (typeof origin === 'string') origin = obj[origin] - for (var name in obj) { - if (name === 'em') continue - res[name] = obj[name] - origin - } - return res -} - -function firstTop(iData) { - var l = iData.height - var data = iData.data - for (var i = 3; i < data.length; i+=4) { - if (data[i] !== 0) { - return Math.floor((i - 3) *.25 / l) - } - } -} - -function firstBottom(iData) { - var l = iData.height - var data = iData.data - for (var i = data.length - 1; i > 0; i -= 4) { - if (data[i] !== 0) { - return Math.floor((i - 3) *.25 / l) - } - } -} +'use strict' + +module.exports = measure + +measure.canvas = document.createElement('canvas') +measure.cache = {} + +function measure (font, o) { + if (!o) o = {} + + if (typeof font === 'string' || Array.isArray(font)) { + o.family = font + } + + var family = Array.isArray(o.family) ? o.family.join(', ') : o.family + if (!family) throw Error('`family` must be defined') + + var fs = o.size || o.fontSize || o.em || 48 + var weight = o.weight || o.fontWeight || '' + var style = o.style || o.fontStyle || '' + var font = [style, weight, fs].join(' ') + 'px ' + family + var origin = o.origin || 'top' + + if (measure.cache[family]) { + // return more precise values if cache has them + if (fs <= measure.cache[family].em) { + return applyOrigin(measure.cache[family], origin) + } + } + + var canvas = o.canvas || measure.canvas + var ctx = canvas.getContext('2d') + var chars = { + upper: o.upper !== undefined ? o.upper : 'H', + lower: o.lower !== undefined ? o.lower : 'x', + descent: o.descent !== undefined ? o.descent : 'p', + ascent: o.ascent !== undefined ? o.ascent : 'h', + tittle: o.tittle !== undefined ? o.tittle : 'i', + overshoot: o.overshoot !== undefined ? o.overshoot : 'O' + } + var l = Math.ceil(fs * 1.5) + canvas.height = l + canvas.width = l * .5 + ctx.font = font + + var char = 'H' + var result = { + top: 0 + } + + // measure line-height + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillStyle = 'black' + ctx.fillText(char, 0, 0) + var topPx = firstTop(ctx.getImageData(0, 0, l, l)) + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'bottom' + ctx.fillText(char, 0, l) + var bottomPx = firstTop(ctx.getImageData(0, 0, l, l)) + result.lineHeight = + result.bottom = l - bottomPx + topPx + + // measure baseline + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'alphabetic' + ctx.fillText(char, 0, l) + var baselinePx = firstTop(ctx.getImageData(0, 0, l, l)) + var baseline = l - baselinePx - 1 + topPx + result.baseline = + result.alphabetic = baseline + + // measure median + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'middle' + ctx.fillText(char, 0, l * .5) + var medianPx = firstTop(ctx.getImageData(0, 0, l, l)) + result.median = + result.middle = l - medianPx - 1 + topPx - l * .5 + + // measure hanging + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'hanging' + ctx.fillText(char, 0, l * .5) + var hangingPx = firstTop(ctx.getImageData(0, 0, l, l)) + result.hanging = l - hangingPx - 1 + topPx - l * .5 + + // measure ideographic + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'ideographic' + ctx.fillText(char, 0, l) + var ideographicPx = firstTop(ctx.getImageData(0, 0, l, l)) + result.ideographic = l - ideographicPx - 1 + topPx + + // measure cap + if (chars.upper) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.upper, 0, 0) + result.upper = firstTop(ctx.getImageData(0, 0, l, l)) + result.capHeight = (result.baseline - result.upper) + } + + // measure x + if (chars.lower) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.lower, 0, 0) + result.lower = firstTop(ctx.getImageData(0, 0, l, l)) + result.xHeight = (result.baseline - result.lower) + } + + // measure tittle + if (chars.tittle) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.tittle, 0, 0) + result.tittle = firstTop(ctx.getImageData(0, 0, l, l)) + } + + // measure ascent + if (chars.ascent) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.ascent, 0, 0) + result.ascent = firstTop(ctx.getImageData(0, 0, l, l)) + } + + // measure descent + if (chars.descent) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.descent, 0, 0) + result.descent = firstBottom(ctx.getImageData(0, 0, l, l)) + } + + // measure overshoot + if (chars.overshoot) { + ctx.clearRect(0, 0, l, l) + ctx.textBaseline = 'top' + ctx.fillText(chars.overshoot, 0, 0) + var overshootPx = firstBottom(ctx.getImageData(0, 0, l, l)) + result.overshoot = overshootPx - baseline + } + + // normalize result + for (var name in result) { + result[name] /= fs + } + + result.em = fs + measure.cache[family] = result + + return applyOrigin(result, origin) +} + +function applyOrigin(obj, origin) { + var res = {} + if (typeof origin === 'string') origin = obj[origin] + for (var name in obj) { + if (name === 'em') continue + res[name] = obj[name] - origin + } + return res +} + +function firstTop(iData) { + var l = iData.height + var data = iData.data + for (var i = 3; i < data.length; i+=4) { + if (data[i] !== 0) { + return Math.floor((i - 3) *.25 / l) + } + } +} + +function firstBottom(iData) { + var l = iData.height + var data = iData.data + for (var i = data.length - 1; i > 0; i -= 4) { + if (data[i] !== 0) { + return Math.floor((i - 3) *.25 / l) + } + } +} },{}],230:[function(_dereq_,module,exports){ "use strict" @@ -55672,134 +55672,134 @@ function createTexture2D(gl) { },{"ndarray":450,"ndarray-ops":444,"typedarray-pool":545}],323:[function(_dereq_,module,exports){ (function (global){ -/** @module gl-util/context */ -'use strict' - -var pick = _dereq_('pick-by-alias') - -module.exports = function setContext (o) { - if (!o) o = {} - else if (typeof o === 'string') o = {container: o} - - // HTMLCanvasElement - if (isCanvas(o)) { - o = {container: o} - } - // HTMLElement - else if (isElement(o)) { - o = {container: o} - } - // WebGLContext - else if (isContext(o)) { - o = {gl: o} - } - // options object - else { - o = pick(o, { - container: 'container target element el canvas holder parent parentNode wrapper use ref root node', - gl: 'gl context webgl glContext', - attrs: 'attributes attrs contextAttributes', - pixelRatio: 'pixelRatio pxRatio px ratio pxratio pixelratio', - width: 'w width', - height: 'h height' - }, true) - } - - if (!o.pixelRatio) o.pixelRatio = global.pixelRatio || 1 - - // make sure there is container and canvas - if (o.gl) { - return o.gl - } - if (o.canvas) { - o.container = o.canvas.parentNode - } - if (o.container) { - if (typeof o.container === 'string') { - var c = document.querySelector(o.container) - if (!c) throw Error('Element ' + o.container + ' is not found') - o.container = c - } - if (isCanvas(o.container)) { - o.canvas = o.container - o.container = o.canvas.parentNode - } - else if (!o.canvas) { - o.canvas = createCanvas() - o.container.appendChild(o.canvas) - resize(o) - } - } - // blank new canvas - else if (!o.canvas) { - if (typeof document !== 'undefined') { - o.container = document.body || document.documentElement - o.canvas = createCanvas() - o.container.appendChild(o.canvas) - resize(o) - } - else { - throw Error('Not DOM environment. Use headless-gl.') - } - } - - // make sure there is context - if (!o.gl) { - try { - o.gl = o.canvas.getContext('webgl', o.attrs) - } catch (e) { - try { - o.gl = o.canvas.getContext('experimental-webgl', o.attrs) - } - catch (e) { - o.gl = o.canvas.getContext('webgl-experimental', o.attrs) - } - } - } - - return o.gl -} - - -function resize (o) { - if (o.container) { - if (o.container == document.body) { - if (!document.body.style.width) o.canvas.width = o.width || (o.pixelRatio * global.innerWidth) - if (!document.body.style.height) o.canvas.height = o.height || (o.pixelRatio * global.innerHeight) - } - else { - var bounds = o.container.getBoundingClientRect() - o.canvas.width = o.width || (bounds.right - bounds.left) - o.canvas.height = o.height || (bounds.bottom - bounds.top) - } - } -} - -function isCanvas (e) { - return typeof e.getContext === 'function' - && 'width' in e - && 'height' in e -} - -function isElement (e) { - return typeof e.nodeName === 'string' && - typeof e.appendChild === 'function' && - typeof e.getBoundingClientRect === 'function' -} - -function isContext (e) { - return typeof e.drawArrays === 'function' || - typeof e.drawElements === 'function' -} - -function createCanvas () { - var canvas = document.createElement('canvas') - canvas.style.position = 'absolute' - canvas.style.top = 0 - canvas.style.left = 0 - - return canvas -} +/** @module gl-util/context */ +'use strict' + +var pick = _dereq_('pick-by-alias') + +module.exports = function setContext (o) { + if (!o) o = {} + else if (typeof o === 'string') o = {container: o} + + // HTMLCanvasElement + if (isCanvas(o)) { + o = {container: o} + } + // HTMLElement + else if (isElement(o)) { + o = {container: o} + } + // WebGLContext + else if (isContext(o)) { + o = {gl: o} + } + // options object + else { + o = pick(o, { + container: 'container target element el canvas holder parent parentNode wrapper use ref root node', + gl: 'gl context webgl glContext', + attrs: 'attributes attrs contextAttributes', + pixelRatio: 'pixelRatio pxRatio px ratio pxratio pixelratio', + width: 'w width', + height: 'h height' + }, true) + } + + if (!o.pixelRatio) o.pixelRatio = global.pixelRatio || 1 + + // make sure there is container and canvas + if (o.gl) { + return o.gl + } + if (o.canvas) { + o.container = o.canvas.parentNode + } + if (o.container) { + if (typeof o.container === 'string') { + var c = document.querySelector(o.container) + if (!c) throw Error('Element ' + o.container + ' is not found') + o.container = c + } + if (isCanvas(o.container)) { + o.canvas = o.container + o.container = o.canvas.parentNode + } + else if (!o.canvas) { + o.canvas = createCanvas() + o.container.appendChild(o.canvas) + resize(o) + } + } + // blank new canvas + else if (!o.canvas) { + if (typeof document !== 'undefined') { + o.container = document.body || document.documentElement + o.canvas = createCanvas() + o.container.appendChild(o.canvas) + resize(o) + } + else { + throw Error('Not DOM environment. Use headless-gl.') + } + } + + // make sure there is context + if (!o.gl) { + try { + o.gl = o.canvas.getContext('webgl', o.attrs) + } catch (e) { + try { + o.gl = o.canvas.getContext('experimental-webgl', o.attrs) + } + catch (e) { + o.gl = o.canvas.getContext('webgl-experimental', o.attrs) + } + } + } + + return o.gl +} + + +function resize (o) { + if (o.container) { + if (o.container == document.body) { + if (!document.body.style.width) o.canvas.width = o.width || (o.pixelRatio * global.innerWidth) + if (!document.body.style.height) o.canvas.height = o.height || (o.pixelRatio * global.innerHeight) + } + else { + var bounds = o.container.getBoundingClientRect() + o.canvas.width = o.width || (bounds.right - bounds.left) + o.canvas.height = o.height || (bounds.bottom - bounds.top) + } + } +} + +function isCanvas (e) { + return typeof e.getContext === 'function' + && 'width' in e + && 'height' in e +} + +function isElement (e) { + return typeof e.nodeName === 'string' && + typeof e.appendChild === 'function' && + typeof e.getBoundingClientRect === 'function' +} + +function isContext (e) { + return typeof e.drawArrays === 'function' || + typeof e.drawElements === 'function' +} + +function createCanvas () { + var canvas = document.createElement('canvas') + canvas.style.position = 'absolute' + canvas.style.top = 0 + canvas.style.left = 0 + + return canvas +} }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"pick-by-alias":465}],324:[function(_dereq_,module,exports){ @@ -58220,59 +58220,59 @@ function tokenizeString(str, opt) { } },{"./index":402}],409:[function(_dereq_,module,exports){ -module.exports = function(strings) { - if (typeof strings === 'string') strings = [strings] - var exprs = [].slice.call(arguments,1) - var parts = [] - for (var i = 0; i < strings.length-1; i++) { - parts.push(strings[i], exprs[i] || '') - } - parts.push(strings[i]) - return parts.join('') -} +module.exports = function(strings) { + if (typeof strings === 'string') strings = [strings] + var exprs = [].slice.call(arguments,1) + var parts = [] + for (var i = 0; i < strings.length-1; i++) { + parts.push(strings[i], exprs[i] || '') + } + parts.push(strings[i]) + return parts.join('') +} },{}],410:[function(_dereq_,module,exports){ (function (global){ -'use strict' - -var isBrowser = _dereq_('is-browser') -var hasHover - -if (typeof global.matchMedia === 'function') { - hasHover = !global.matchMedia('(hover: none)').matches -} -else { - hasHover = isBrowser -} - -module.exports = hasHover +'use strict' + +var isBrowser = _dereq_('is-browser') +var hasHover + +if (typeof global.matchMedia === 'function') { + hasHover = !global.matchMedia('(hover: none)').matches +} +else { + hasHover = isBrowser +} + +module.exports = hasHover }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) },{"is-browser":417}],411:[function(_dereq_,module,exports){ -'use strict' - -var isBrowser = _dereq_('is-browser') - -function detect() { - var supported = false - - try { - var opts = Object.defineProperty({}, 'passive', { - get: function() { - supported = true - } - }) - - window.addEventListener('test', null, opts) - window.removeEventListener('test', null, opts) - } catch(e) { - supported = false - } - - return supported -} - -module.exports = isBrowser && detect() +'use strict' + +var isBrowser = _dereq_('is-browser') + +function detect() { + var supported = false + + try { + var opts = Object.defineProperty({}, 'passive', { + get: function() { + supported = true + } + }) + + window.addEventListener('test', null, opts) + window.removeEventListener('test', null, opts) + } catch(e) { + supported = false + } + + return supported +} + +module.exports = isBrowser && detect() },{"is-browser":417}],412:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { @@ -59268,55 +59268,55 @@ module.exports = function (x) { }; },{}],423:[function(_dereq_,module,exports){ -'use strict'; - -/** - * Is this string all whitespace? - * This solution kind of makes my brain hurt, but it's significantly faster - * than !str.trim() or any other solution I could find. - * - * whitespace codes from: http://en.wikipedia.org/wiki/Whitespace_character - * and verified with: - * - * for(var i = 0; i < 65536; i++) { - * var s = String.fromCharCode(i); - * if(+s===0 && !s.trim()) console.log(i, s); - * } - * - * which counts a couple of these as *not* whitespace, but finds nothing else - * that *is* whitespace. Note that charCodeAt stops at 16 bits, but it appears - * that there are no whitespace characters above this, and code points above - * this do not map onto white space characters. - */ - -module.exports = function(str){ - var l = str.length, - a; - for(var i = 0; i < l; i++) { - a = str.charCodeAt(i); - if((a < 9 || a > 13) && (a !== 32) && (a !== 133) && (a !== 160) && - (a !== 5760) && (a !== 6158) && (a < 8192 || a > 8205) && - (a !== 8232) && (a !== 8233) && (a !== 8239) && (a !== 8287) && - (a !== 8288) && (a !== 12288) && (a !== 65279)) { - return false; - } - } - return true; -} +'use strict'; + +/** + * Is this string all whitespace? + * This solution kind of makes my brain hurt, but it's significantly faster + * than !str.trim() or any other solution I could find. + * + * whitespace codes from: http://en.wikipedia.org/wiki/Whitespace_character + * and verified with: + * + * for(var i = 0; i < 65536; i++) { + * var s = String.fromCharCode(i); + * if(+s===0 && !s.trim()) console.log(i, s); + * } + * + * which counts a couple of these as *not* whitespace, but finds nothing else + * that *is* whitespace. Note that charCodeAt stops at 16 bits, but it appears + * that there are no whitespace characters above this, and code points above + * this do not map onto white space characters. + */ + +module.exports = function(str){ + var l = str.length, + a; + for(var i = 0; i < l; i++) { + a = str.charCodeAt(i); + if((a < 9 || a > 13) && (a !== 32) && (a !== 133) && (a !== 160) && + (a !== 5760) && (a !== 6158) && (a < 8192 || a > 8205) && + (a !== 8232) && (a !== 8233) && (a !== 8239) && (a !== 8287) && + (a !== 8288) && (a !== 12288) && (a !== 65279)) { + return false; + } + } + return true; +} },{}],424:[function(_dereq_,module,exports){ -'use strict' - -module.exports = function isPath(str) { - if (typeof str !== 'string') return false - - str = str.trim() - - // https://www.w3.org/TR/SVG/paths.html#PathDataBNF - if (/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\dz]$/i.test(str) && str.length > 4) return true - - return false -} +'use strict' + +module.exports = function isPath(str) { + if (typeof str !== 'string') return false + + str = str.trim() + + // https://www.w3.org/TR/SVG/paths.html#PathDataBNF + if (/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(str) && /[\dz]$/i.test(str) && str.length > 4) return true + + return false +} },{}],425:[function(_dereq_,module,exports){ function lerp(v0, v1, t) { @@ -59743,204 +59743,204 @@ module.exports = Math.log2 || function (x) { }; },{}],433:[function(_dereq_,module,exports){ -'use strict' - -var bsearch = _dereq_('binary-search-bounds') -var m4interp = _dereq_('mat4-interpolate') -var invert44 = _dereq_('gl-mat4/invert') -var rotateX = _dereq_('gl-mat4/rotateX') -var rotateY = _dereq_('gl-mat4/rotateY') -var rotateZ = _dereq_('gl-mat4/rotateZ') -var lookAt = _dereq_('gl-mat4/lookAt') -var translate = _dereq_('gl-mat4/translate') -var scale = _dereq_('gl-mat4/scale') -var normalize = _dereq_('gl-vec3/normalize') - -var DEFAULT_CENTER = [0,0,0] - -module.exports = createMatrixCameraController - -function MatrixCameraController(initialMatrix) { - this._components = initialMatrix.slice() - this._time = [0] - this.prevMatrix = initialMatrix.slice() - this.nextMatrix = initialMatrix.slice() - this.computedMatrix = initialMatrix.slice() - this.computedInverse = initialMatrix.slice() - this.computedEye = [0,0,0] - this.computedUp = [0,0,0] - this.computedCenter = [0,0,0] - this.computedRadius = [0] - this._limits = [-Infinity, Infinity] -} - -var proto = MatrixCameraController.prototype - -proto.recalcMatrix = function(t) { - var time = this._time - var tidx = bsearch.le(time, t) - var mat = this.computedMatrix - if(tidx < 0) { - return - } - var comps = this._components - if(tidx === time.length-1) { - var ptr = 16*tidx - for(var i=0; i<16; ++i) { - mat[i] = comps[ptr++] - } - } else { - var dt = (time[tidx+1] - time[tidx]) - var ptr = 16*tidx - var prev = this.prevMatrix - var allEqual = true - for(var i=0; i<16; ++i) { - prev[i] = comps[ptr++] - } - var next = this.nextMatrix - for(var i=0; i<16; ++i) { - next[i] = comps[ptr++] - allEqual = allEqual && (prev[i] === next[i]) - } - if(dt < 1e-6 || allEqual) { - for(var i=0; i<16; ++i) { - mat[i] = prev[i] - } - } else { - m4interp(mat, prev, next, (t - time[tidx])/dt) - } - } - - var up = this.computedUp - up[0] = mat[1] - up[1] = mat[5] - up[2] = mat[9] - normalize(up, up) - - var imat = this.computedInverse - invert44(imat, mat) - var eye = this.computedEye - var w = imat[15] - eye[0] = imat[12]/w - eye[1] = imat[13]/w - eye[2] = imat[14]/w - - var center = this.computedCenter - var radius = Math.exp(this.computedRadius[0]) - for(var i=0; i<3; ++i) { - center[i] = eye[i] - mat[2+4*i] * radius - } -} - -proto.idle = function(t) { - if(t < this.lastT()) { - return - } - var mc = this._components - var ptr = mc.length-16 - for(var i=0; i<16; ++i) { - mc.push(mc[ptr++]) - } - this._time.push(t) -} - -proto.flush = function(t) { - var idx = bsearch.gt(this._time, t) - 2 - if(idx < 0) { - return - } - this._time.splice(0, idx) - this._components.splice(0, 16*idx) -} - -proto.lastT = function() { - return this._time[this._time.length-1] -} - -proto.lookAt = function(t, eye, center, up) { - this.recalcMatrix(t) - eye = eye || this.computedEye - center = center || DEFAULT_CENTER - up = up || this.computedUp - this.setMatrix(t, lookAt(this.computedMatrix, eye, center, up)) - var d2 = 0.0 - for(var i=0; i<3; ++i) { - d2 += Math.pow(center[i] - eye[i], 2) - } - d2 = Math.log(Math.sqrt(d2)) - this.computedRadius[0] = d2 -} - -proto.rotate = function(t, yaw, pitch, roll) { - this.recalcMatrix(t) - var mat = this.computedInverse - if(yaw) rotateY(mat, mat, yaw) - if(pitch) rotateX(mat, mat, pitch) - if(roll) rotateZ(mat, mat, roll) - this.setMatrix(t, invert44(this.computedMatrix, mat)) -} - -var tvec = [0,0,0] - -proto.pan = function(t, dx, dy, dz) { - tvec[0] = -(dx || 0.0) - tvec[1] = -(dy || 0.0) - tvec[2] = -(dz || 0.0) - this.recalcMatrix(t) - var mat = this.computedInverse - translate(mat, mat, tvec) - this.setMatrix(t, invert44(mat, mat)) -} - -proto.translate = function(t, dx, dy, dz) { - tvec[0] = dx || 0.0 - tvec[1] = dy || 0.0 - tvec[2] = dz || 0.0 - this.recalcMatrix(t) - var mat = this.computedMatrix - translate(mat, mat, tvec) - this.setMatrix(t, mat) -} - -proto.setMatrix = function(t, mat) { - if(t < this.lastT()) { - return - } - this._time.push(t) - for(var i=0; i<16; ++i) { - this._components.push(mat[i]) - } -} - -proto.setDistance = function(t, d) { - this.computedRadius[0] = d -} - -proto.setDistanceLimits = function(a,b) { - var lim = this._limits - lim[0] = a - lim[1] = b -} - -proto.getDistanceLimits = function(out) { - var lim = this._limits - if(out) { - out[0] = lim[0] - out[1] = lim[1] - return out - } - return lim -} - -function createMatrixCameraController(options) { - options = options || {} - var matrix = options.matrix || - [1,0,0,0, - 0,1,0,0, - 0,0,1,0, - 0,0,0,1] - return new MatrixCameraController(matrix) -} +'use strict' + +var bsearch = _dereq_('binary-search-bounds') +var m4interp = _dereq_('mat4-interpolate') +var invert44 = _dereq_('gl-mat4/invert') +var rotateX = _dereq_('gl-mat4/rotateX') +var rotateY = _dereq_('gl-mat4/rotateY') +var rotateZ = _dereq_('gl-mat4/rotateZ') +var lookAt = _dereq_('gl-mat4/lookAt') +var translate = _dereq_('gl-mat4/translate') +var scale = _dereq_('gl-mat4/scale') +var normalize = _dereq_('gl-vec3/normalize') + +var DEFAULT_CENTER = [0,0,0] + +module.exports = createMatrixCameraController + +function MatrixCameraController(initialMatrix) { + this._components = initialMatrix.slice() + this._time = [0] + this.prevMatrix = initialMatrix.slice() + this.nextMatrix = initialMatrix.slice() + this.computedMatrix = initialMatrix.slice() + this.computedInverse = initialMatrix.slice() + this.computedEye = [0,0,0] + this.computedUp = [0,0,0] + this.computedCenter = [0,0,0] + this.computedRadius = [0] + this._limits = [-Infinity, Infinity] +} + +var proto = MatrixCameraController.prototype + +proto.recalcMatrix = function(t) { + var time = this._time + var tidx = bsearch.le(time, t) + var mat = this.computedMatrix + if(tidx < 0) { + return + } + var comps = this._components + if(tidx === time.length-1) { + var ptr = 16*tidx + for(var i=0; i<16; ++i) { + mat[i] = comps[ptr++] + } + } else { + var dt = (time[tidx+1] - time[tidx]) + var ptr = 16*tidx + var prev = this.prevMatrix + var allEqual = true + for(var i=0; i<16; ++i) { + prev[i] = comps[ptr++] + } + var next = this.nextMatrix + for(var i=0; i<16; ++i) { + next[i] = comps[ptr++] + allEqual = allEqual && (prev[i] === next[i]) + } + if(dt < 1e-6 || allEqual) { + for(var i=0; i<16; ++i) { + mat[i] = prev[i] + } + } else { + m4interp(mat, prev, next, (t - time[tidx])/dt) + } + } + + var up = this.computedUp + up[0] = mat[1] + up[1] = mat[5] + up[2] = mat[9] + normalize(up, up) + + var imat = this.computedInverse + invert44(imat, mat) + var eye = this.computedEye + var w = imat[15] + eye[0] = imat[12]/w + eye[1] = imat[13]/w + eye[2] = imat[14]/w + + var center = this.computedCenter + var radius = Math.exp(this.computedRadius[0]) + for(var i=0; i<3; ++i) { + center[i] = eye[i] - mat[2+4*i] * radius + } +} + +proto.idle = function(t) { + if(t < this.lastT()) { + return + } + var mc = this._components + var ptr = mc.length-16 + for(var i=0; i<16; ++i) { + mc.push(mc[ptr++]) + } + this._time.push(t) +} + +proto.flush = function(t) { + var idx = bsearch.gt(this._time, t) - 2 + if(idx < 0) { + return + } + this._time.splice(0, idx) + this._components.splice(0, 16*idx) +} + +proto.lastT = function() { + return this._time[this._time.length-1] +} + +proto.lookAt = function(t, eye, center, up) { + this.recalcMatrix(t) + eye = eye || this.computedEye + center = center || DEFAULT_CENTER + up = up || this.computedUp + this.setMatrix(t, lookAt(this.computedMatrix, eye, center, up)) + var d2 = 0.0 + for(var i=0; i<3; ++i) { + d2 += Math.pow(center[i] - eye[i], 2) + } + d2 = Math.log(Math.sqrt(d2)) + this.computedRadius[0] = d2 +} + +proto.rotate = function(t, yaw, pitch, roll) { + this.recalcMatrix(t) + var mat = this.computedInverse + if(yaw) rotateY(mat, mat, yaw) + if(pitch) rotateX(mat, mat, pitch) + if(roll) rotateZ(mat, mat, roll) + this.setMatrix(t, invert44(this.computedMatrix, mat)) +} + +var tvec = [0,0,0] + +proto.pan = function(t, dx, dy, dz) { + tvec[0] = -(dx || 0.0) + tvec[1] = -(dy || 0.0) + tvec[2] = -(dz || 0.0) + this.recalcMatrix(t) + var mat = this.computedInverse + translate(mat, mat, tvec) + this.setMatrix(t, invert44(mat, mat)) +} + +proto.translate = function(t, dx, dy, dz) { + tvec[0] = dx || 0.0 + tvec[1] = dy || 0.0 + tvec[2] = dz || 0.0 + this.recalcMatrix(t) + var mat = this.computedMatrix + translate(mat, mat, tvec) + this.setMatrix(t, mat) +} + +proto.setMatrix = function(t, mat) { + if(t < this.lastT()) { + return + } + this._time.push(t) + for(var i=0; i<16; ++i) { + this._components.push(mat[i]) + } +} + +proto.setDistance = function(t, d) { + this.computedRadius[0] = d +} + +proto.setDistanceLimits = function(a,b) { + var lim = this._limits + lim[0] = a + lim[1] = b +} + +proto.getDistanceLimits = function(out) { + var lim = this._limits + if(out) { + out[0] = lim[0] + out[1] = lim[1] + return out + } + return lim +} + +function createMatrixCameraController(options) { + options = options || {} + var matrix = options.matrix || + [1,0,0,0, + 0,1,0,0, + 0,0,1,0, + 0,0,0,1] + return new MatrixCameraController(matrix) +} },{"binary-search-bounds":91,"gl-mat4/invert":265,"gl-mat4/lookAt":266,"gl-mat4/rotateX":271,"gl-mat4/rotateY":272,"gl-mat4/rotateZ":273,"gl-mat4/scale":274,"gl-mat4/translate":275,"gl-vec3/normalize":356,"mat4-interpolate":430}],434:[function(_dereq_,module,exports){ 'use strict' @@ -63759,228 +63759,228 @@ module.exports = function padLeft(str, num, ch) { return repeat(ch, num) + str; }; },{"repeat-string":503}],458:[function(_dereq_,module,exports){ -'use strict' - -/** - * @module parenthesis - */ - -function parse (str, opts) { - // pretend non-string parsed per-se - if (typeof str !== 'string') return [str] - - var res = [str] - - if (typeof opts === 'string' || Array.isArray(opts)) { - opts = {brackets: opts} - } - else if (!opts) opts = {} - - var brackets = opts.brackets ? (Array.isArray(opts.brackets) ? opts.brackets : [opts.brackets]) : ['{}', '[]', '()'] - - var escape = opts.escape || '___' - - var flat = !!opts.flat - - brackets.forEach(function (bracket) { - // create parenthesis regex - var pRE = new RegExp(['\\', bracket[0], '[^\\', bracket[0], '\\', bracket[1], ']*\\', bracket[1]].join('')) - - var ids = [] - - function replaceToken(token, idx, str){ - // save token to res - var refId = res.push(token.slice(bracket[0].length, -bracket[1].length)) - 1 - - ids.push(refId) - - return escape + refId + escape - } - - res.forEach(function (str, i) { - var prevStr - - // replace paren tokens till there’s none - var a = 0 - while (str != prevStr) { - prevStr = str - str = str.replace(pRE, replaceToken) - if (a++ > 10e3) throw Error('References have circular dependency. Please, check them.') - } - - res[i] = str - }) - - // wrap found refs to brackets - ids = ids.reverse() - res = res.map(function (str) { - ids.forEach(function (id) { - str = str.replace(new RegExp('(\\' + escape + id + '\\' + escape + ')', 'g'), bracket[0] + '$1' + bracket[1]) - }) - return str - }) - }) - - var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape) - - // transform references to tree - function nest (str, refs, escape) { - var res = [], match - - var a = 0 - while (match = re.exec(str)) { - if (a++ > 10e3) throw Error('Circular references in parenthesis') - - res.push(str.slice(0, match.index)) - - res.push(nest(refs[match[1]], refs)) - - str = str.slice(match.index + match[0].length) - } - - res.push(str) - - return res - } - - return flat ? res : nest(res[0], res) -} - -function stringify (arg, opts) { - if (opts && opts.flat) { - var escape = opts && opts.escape || '___' - - var str = arg[0], prevStr - - // pretend bad string stringified with no parentheses - if (!str) return '' - - - var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape) - - var a = 0 - while (str != prevStr) { - if (a++ > 10e3) throw Error('Circular references in ' + arg) - prevStr = str - str = str.replace(re, replaceRef) - } - - return str - } - - return arg.reduce(function f (prev, curr) { - if (Array.isArray(curr)) { - curr = curr.reduce(f, '') - } - return prev + curr - }, '') - - function replaceRef(match, idx){ - if (arg[idx] == null) throw Error('Reference ' + idx + 'is undefined') - return arg[idx] - } -} - -function parenthesis (arg, opts) { - if (Array.isArray(arg)) { - return stringify(arg, opts) - } - else { - return parse(arg, opts) - } -} - -parenthesis.parse = parse -parenthesis.stringify = stringify - -module.exports = parenthesis +'use strict' + +/** + * @module parenthesis + */ + +function parse (str, opts) { + // pretend non-string parsed per-se + if (typeof str !== 'string') return [str] + + var res = [str] + + if (typeof opts === 'string' || Array.isArray(opts)) { + opts = {brackets: opts} + } + else if (!opts) opts = {} + + var brackets = opts.brackets ? (Array.isArray(opts.brackets) ? opts.brackets : [opts.brackets]) : ['{}', '[]', '()'] + + var escape = opts.escape || '___' + + var flat = !!opts.flat + + brackets.forEach(function (bracket) { + // create parenthesis regex + var pRE = new RegExp(['\\', bracket[0], '[^\\', bracket[0], '\\', bracket[1], ']*\\', bracket[1]].join('')) + + var ids = [] + + function replaceToken(token, idx, str){ + // save token to res + var refId = res.push(token.slice(bracket[0].length, -bracket[1].length)) - 1 + + ids.push(refId) + + return escape + refId + escape + } + + res.forEach(function (str, i) { + var prevStr + + // replace paren tokens till there’s none + var a = 0 + while (str != prevStr) { + prevStr = str + str = str.replace(pRE, replaceToken) + if (a++ > 10e3) throw Error('References have circular dependency. Please, check them.') + } + + res[i] = str + }) + + // wrap found refs to brackets + ids = ids.reverse() + res = res.map(function (str) { + ids.forEach(function (id) { + str = str.replace(new RegExp('(\\' + escape + id + '\\' + escape + ')', 'g'), bracket[0] + '$1' + bracket[1]) + }) + return str + }) + }) + + var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape) + + // transform references to tree + function nest (str, refs, escape) { + var res = [], match + + var a = 0 + while (match = re.exec(str)) { + if (a++ > 10e3) throw Error('Circular references in parenthesis') + + res.push(str.slice(0, match.index)) + + res.push(nest(refs[match[1]], refs)) + + str = str.slice(match.index + match[0].length) + } + + res.push(str) + + return res + } + + return flat ? res : nest(res[0], res) +} + +function stringify (arg, opts) { + if (opts && opts.flat) { + var escape = opts && opts.escape || '___' + + var str = arg[0], prevStr + + // pretend bad string stringified with no parentheses + if (!str) return '' + + + var re = new RegExp('\\' + escape + '([0-9]+)' + '\\' + escape) + + var a = 0 + while (str != prevStr) { + if (a++ > 10e3) throw Error('Circular references in ' + arg) + prevStr = str + str = str.replace(re, replaceRef) + } + + return str + } + + return arg.reduce(function f (prev, curr) { + if (Array.isArray(curr)) { + curr = curr.reduce(f, '') + } + return prev + curr + }, '') + + function replaceRef(match, idx){ + if (arg[idx] == null) throw Error('Reference ' + idx + 'is undefined') + return arg[idx] + } +} + +function parenthesis (arg, opts) { + if (Array.isArray(arg)) { + return stringify(arg, opts) + } + else { + return parse(arg, opts) + } +} + +parenthesis.parse = parse +parenthesis.stringify = stringify + +module.exports = parenthesis },{}],459:[function(_dereq_,module,exports){ -'use strict' - -var pick = _dereq_('pick-by-alias') - -module.exports = parseRect - -function parseRect (arg) { - var rect - - // direct arguments sequence - if (arguments.length > 1) { - arg = arguments - } - - // svg viewbox - if (typeof arg === 'string') { - arg = arg.split(/\s/).map(parseFloat) - } - else if (typeof arg === 'number') { - arg = [arg] - } - - // 0, 0, 100, 100 - array-like - if (arg.length && typeof arg[0] === 'number') { - // [w, w] - if (arg.length === 1) { - rect = { - width: arg[0], - height: arg[0], - x: 0, y: 0 - } - } - // [w, h] - else if (arg.length === 2) { - rect = { - width: arg[0], - height: arg[1], - x: 0, y: 0 - } - } - // [l, t, r, b] - else { - rect = { - x: arg[0], - y: arg[1], - width: (arg[2] - arg[0]) || 0, - height: (arg[3] - arg[1]) || 0 - } - } - } - // {x, y, w, h} or {l, t, b, r} - else if (arg) { - arg = pick(arg, { - left: 'x l left Left', - top: 'y t top Top', - width: 'w width W Width', - height: 'h height W Width', - bottom: 'b bottom Bottom', - right: 'r right Right' - }) - - rect = { - x: arg.left || 0, - y: arg.top || 0 - } - - if (arg.width == null) { - if (arg.right) rect.width = arg.right - rect.x - else rect.width = 0 - } - else { - rect.width = arg.width - } - - if (arg.height == null) { - if (arg.bottom) rect.height = arg.bottom - rect.y - else rect.height = 0 - } - else { - rect.height = arg.height - } - } - - return rect -} +'use strict' + +var pick = _dereq_('pick-by-alias') + +module.exports = parseRect + +function parseRect (arg) { + var rect + + // direct arguments sequence + if (arguments.length > 1) { + arg = arguments + } + + // svg viewbox + if (typeof arg === 'string') { + arg = arg.split(/\s/).map(parseFloat) + } + else if (typeof arg === 'number') { + arg = [arg] + } + + // 0, 0, 100, 100 - array-like + if (arg.length && typeof arg[0] === 'number') { + // [w, w] + if (arg.length === 1) { + rect = { + width: arg[0], + height: arg[0], + x: 0, y: 0 + } + } + // [w, h] + else if (arg.length === 2) { + rect = { + width: arg[0], + height: arg[1], + x: 0, y: 0 + } + } + // [l, t, r, b] + else { + rect = { + x: arg[0], + y: arg[1], + width: (arg[2] - arg[0]) || 0, + height: (arg[3] - arg[1]) || 0 + } + } + } + // {x, y, w, h} or {l, t, b, r} + else if (arg) { + arg = pick(arg, { + left: 'x l left Left', + top: 'y t top Top', + width: 'w width W Width', + height: 'h height W Width', + bottom: 'b bottom Bottom', + right: 'r right Right' + }) + + rect = { + x: arg.left || 0, + y: arg.top || 0 + } + + if (arg.width == null) { + if (arg.right) rect.width = arg.right - rect.x + else rect.width = 0 + } + else { + rect.width = arg.width + } + + if (arg.height == null) { + if (arg.bottom) rect.height = arg.bottom - rect.y + else rect.height = 0 + } + else { + rect.height = arg.height + } + } + + return rect +} },{"pick-by-alias":465}],460:[function(_dereq_,module,exports){ @@ -64232,83 +64232,83 @@ exports.rank = rank exports.unrank = unrank },{"invert-permutation":415,"typedarray-pool":545}],465:[function(_dereq_,module,exports){ -'use strict' - - -module.exports = function pick (src, props, keepRest) { - var result = {}, prop, i - - if (typeof props === 'string') props = toList(props) - if (Array.isArray(props)) { - var res = {} - for (i = 0; i < props.length; i++) { - res[props[i]] = true - } - props = res - } - - // convert strings to lists - for (prop in props) { - props[prop] = toList(props[prop]) - } - - // keep-rest strategy requires unmatched props to be preserved - var occupied = {} - - for (prop in props) { - var aliases = props[prop] - - if (Array.isArray(aliases)) { - for (i = 0; i < aliases.length; i++) { - var alias = aliases[i] - - if (keepRest) { - occupied[alias] = true - } - - if (alias in src) { - result[prop] = src[alias] - - if (keepRest) { - for (var j = i; j < aliases.length; j++) { - occupied[aliases[j]] = true - } - } - - break - } - } - } - else if (prop in src) { - if (props[prop]) { - result[prop] = src[prop] - } - - if (keepRest) { - occupied[prop] = true - } - } - } - - if (keepRest) { - for (prop in src) { - if (occupied[prop]) continue - result[prop] = src[prop] - } - } - - return result -} - -var CACHE = {} - -function toList(arg) { - if (CACHE[arg]) return CACHE[arg] - if (typeof arg === 'string') { - arg = CACHE[arg] = arg.split(/\s*,\s*|\s+/) - } - return arg -} +'use strict' + + +module.exports = function pick (src, props, keepRest) { + var result = {}, prop, i + + if (typeof props === 'string') props = toList(props) + if (Array.isArray(props)) { + var res = {} + for (i = 0; i < props.length; i++) { + res[props[i]] = true + } + props = res + } + + // convert strings to lists + for (prop in props) { + props[prop] = toList(props[prop]) + } + + // keep-rest strategy requires unmatched props to be preserved + var occupied = {} + + for (prop in props) { + var aliases = props[prop] + + if (Array.isArray(aliases)) { + for (i = 0; i < aliases.length; i++) { + var alias = aliases[i] + + if (keepRest) { + occupied[alias] = true + } + + if (alias in src) { + result[prop] = src[alias] + + if (keepRest) { + for (var j = i; j < aliases.length; j++) { + occupied[aliases[j]] = true + } + } + + break + } + } + } + else if (prop in src) { + if (props[prop]) { + result[prop] = src[prop] + } + + if (keepRest) { + occupied[prop] = true + } + } + } + + if (keepRest) { + for (prop in src) { + if (occupied[prop]) continue + result[prop] = src[prop] + } + } + + return result +} + +var CACHE = {} + +function toList(arg) { + if (CACHE[arg]) return CACHE[arg] + if (typeof arg === 'string') { + arg = CACHE[arg] = arg.split(/\s*,\s*|\s+/) + } + return arg +} },{}],466:[function(_dereq_,module,exports){ "use strict" @@ -64703,360 +64703,360 @@ function planarGraphToPolyline(edges, positions) { return result } },{"./lib/trim-leaves":467,"edges-to-adjacency-list":171,"planar-dual":466,"point-in-big-polygon":472,"robust-sum":515,"two-product":543,"uniq":547}],469:[function(_dereq_,module,exports){ -'use strict' - -module.exports = _dereq_('./quad') +'use strict' + +module.exports = _dereq_('./quad') },{"./quad":471}],470:[function(_dereq_,module,exports){ arguments[4][111][0].apply(exports,arguments) },{"dup":111}],471:[function(_dereq_,module,exports){ -/** - * @module point-cluster/quad - * - * Bucket based quad tree clustering - */ - -'use strict' - -var search = _dereq_('binary-search-bounds') -var clamp = _dereq_('clamp') -var rect = _dereq_('parse-rect') -var getBounds = _dereq_('array-bounds') -var pick = _dereq_('pick-by-alias') -var defined = _dereq_('defined') -var flatten = _dereq_('flatten-vertex-data') -var isObj = _dereq_('is-obj') -var dtype = _dereq_('dtype') -var log2 = _dereq_('math-log2') - - -module.exports = function cluster (srcPoints, options) { - if (!options) { options = {} } - - srcPoints = flatten(srcPoints, 'float64') - - options = pick(options, { - bounds: 'range bounds dataBox databox', - maxDepth: 'depth maxDepth maxdepth level maxLevel maxlevel levels', - dtype: 'type dtype format out dst output destination' - // sort: 'sortBy sortby sort', - // pick: 'pick levelPoint', - // nodeSize: 'node nodeSize minNodeSize minSize size' - }) - - // let nodeSize = defined(options.nodeSize, 1) - var maxDepth = defined(options.maxDepth, 255) - var bounds = defined(options.bounds, getBounds(srcPoints, 2)) - if (bounds[0] === bounds[2]) { bounds[2]++ } - if (bounds[1] === bounds[3]) { bounds[3]++ } - - var points = normalize(srcPoints, bounds) - - // init variables - var n = srcPoints.length >>> 1 - var ids - if (!options.dtype) { options.dtype = 'array' } - - if (typeof options.dtype === 'string') { - ids = new (dtype(options.dtype))(n) - } - else if (options.dtype) { - ids = options.dtype - if (Array.isArray(ids)) { ids.length = n } - } - for (var i = 0; i < n; ++i) { - ids[i] = i - } - - // point indexes for levels [0: [a,b,c,d], 1: [a,b,c,d,e,f,...], ...] - var levels = [] - - // starting indexes of subranges in sub levels, levels.length * 4 - var sublevels = [] - - // unique group ids, sorted in z-curve fashion within levels - var groups = [] - - // level offsets in `ids` - var offsets = [] - - - // sort points - sort(0, 0, 1, ids, 0, 1) - - - // return reordered ids with provided methods - // save level offsets in output buffer - var offset = 0 - for (var level = 0; level < levels.length; level++) { - var levelItems = levels[level] - if (ids.set) { ids.set(levelItems, offset) } - else { - for (var i$1 = 0, l = levelItems.length; i$1 < l; i$1++) { - ids[i$1 + offset] = levelItems[i$1] - } - } - var nextOffset = offset + levels[level].length - offsets[level] = [offset, nextOffset] - offset = nextOffset - } - - ids.range = range - - return ids - - - - // FIXME: it is possible to create one typed array heap and reuse that to avoid memory blow - function sort (x, y, diam, ids, level, group) { - if (!ids.length) { return null } - - // save first point as level representative - var levelItems = levels[level] || (levels[level] = []) - var levelGroups = groups[level] || (groups[level] = []) - var sublevel = sublevels[level] || (sublevels[level] = []) - var offset = levelItems.length - - level++ - - // max depth reached - put all items into a first group - if (level > maxDepth) { - for (var i = 0; i < ids.length; i++) { - levelItems.push(ids[i]) - levelGroups.push(group) - sublevel.push(null, null, null, null) - } - - return offset - } - - levelItems.push(ids[0]) - levelGroups.push(group) - - if (ids.length <= 1) { - sublevel.push(null, null, null, null) - return offset - } - - - var d2 = diam * .5 - var cx = x + d2, cy = y + d2 - - // distribute points by 4 buckets - var lolo = [], lohi = [], hilo = [], hihi = [] - - for (var i$1 = 1, l = ids.length; i$1 < l; i$1++) { - var idx = ids[i$1], - x$1 = points[idx * 2], - y$1 = points[idx * 2 + 1] - x$1 < cx ? (y$1 < cy ? lolo.push(idx) : lohi.push(idx)) : (y$1 < cy ? hilo.push(idx) : hihi.push(idx)) - } - - group <<= 2 - sublevel.push( - sort(x, y, d2, lolo, level, group), - sort(x, cy, d2, lohi, level, group + 1), - sort(cx, y, d2, hilo, level, group + 2), - sort(cx, cy, d2, hihi, level, group + 3) - ) - - return offset - } - - // get all points within the passed range +/** + * @module point-cluster/quad + * + * Bucket based quad tree clustering + */ + +'use strict' + +var search = _dereq_('binary-search-bounds') +var clamp = _dereq_('clamp') +var rect = _dereq_('parse-rect') +var getBounds = _dereq_('array-bounds') +var pick = _dereq_('pick-by-alias') +var defined = _dereq_('defined') +var flatten = _dereq_('flatten-vertex-data') +var isObj = _dereq_('is-obj') +var dtype = _dereq_('dtype') +var log2 = _dereq_('math-log2') + + +module.exports = function cluster (srcPoints, options) { + if (!options) { options = {} } + + srcPoints = flatten(srcPoints, 'float64') + + options = pick(options, { + bounds: 'range bounds dataBox databox', + maxDepth: 'depth maxDepth maxdepth level maxLevel maxlevel levels', + dtype: 'type dtype format out dst output destination' + // sort: 'sortBy sortby sort', + // pick: 'pick levelPoint', + // nodeSize: 'node nodeSize minNodeSize minSize size' + }) + + // let nodeSize = defined(options.nodeSize, 1) + var maxDepth = defined(options.maxDepth, 255) + var bounds = defined(options.bounds, getBounds(srcPoints, 2)) + if (bounds[0] === bounds[2]) { bounds[2]++ } + if (bounds[1] === bounds[3]) { bounds[3]++ } + + var points = normalize(srcPoints, bounds) + + // init variables + var n = srcPoints.length >>> 1 + var ids + if (!options.dtype) { options.dtype = 'array' } + + if (typeof options.dtype === 'string') { + ids = new (dtype(options.dtype))(n) + } + else if (options.dtype) { + ids = options.dtype + if (Array.isArray(ids)) { ids.length = n } + } + for (var i = 0; i < n; ++i) { + ids[i] = i + } + + // point indexes for levels [0: [a,b,c,d], 1: [a,b,c,d,e,f,...], ...] + var levels = [] + + // starting indexes of subranges in sub levels, levels.length * 4 + var sublevels = [] + + // unique group ids, sorted in z-curve fashion within levels + var groups = [] + + // level offsets in `ids` + var offsets = [] + + + // sort points + sort(0, 0, 1, ids, 0, 1) + + + // return reordered ids with provided methods + // save level offsets in output buffer + var offset = 0 + for (var level = 0; level < levels.length; level++) { + var levelItems = levels[level] + if (ids.set) { ids.set(levelItems, offset) } + else { + for (var i$1 = 0, l = levelItems.length; i$1 < l; i$1++) { + ids[i$1 + offset] = levelItems[i$1] + } + } + var nextOffset = offset + levels[level].length + offsets[level] = [offset, nextOffset] + offset = nextOffset + } + + ids.range = range + + return ids + + + + // FIXME: it is possible to create one typed array heap and reuse that to avoid memory blow + function sort (x, y, diam, ids, level, group) { + if (!ids.length) { return null } + + // save first point as level representative + var levelItems = levels[level] || (levels[level] = []) + var levelGroups = groups[level] || (groups[level] = []) + var sublevel = sublevels[level] || (sublevels[level] = []) + var offset = levelItems.length + + level++ + + // max depth reached - put all items into a first group + if (level > maxDepth) { + for (var i = 0; i < ids.length; i++) { + levelItems.push(ids[i]) + levelGroups.push(group) + sublevel.push(null, null, null, null) + } + + return offset + } + + levelItems.push(ids[0]) + levelGroups.push(group) + + if (ids.length <= 1) { + sublevel.push(null, null, null, null) + return offset + } + + + var d2 = diam * .5 + var cx = x + d2, cy = y + d2 + + // distribute points by 4 buckets + var lolo = [], lohi = [], hilo = [], hihi = [] + + for (var i$1 = 1, l = ids.length; i$1 < l; i$1++) { + var idx = ids[i$1], + x$1 = points[idx * 2], + y$1 = points[idx * 2 + 1] + x$1 < cx ? (y$1 < cy ? lolo.push(idx) : lohi.push(idx)) : (y$1 < cy ? hilo.push(idx) : hihi.push(idx)) + } + + group <<= 2 + sublevel.push( + sort(x, y, d2, lolo, level, group), + sort(x, cy, d2, lohi, level, group + 1), + sort(cx, y, d2, hilo, level, group + 2), + sort(cx, cy, d2, hihi, level, group + 3) + ) + + return offset + } + + // get all points within the passed range function range () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; - - var options - - if (isObj(args[args.length - 1])) { - var arg = args.pop() - - // detect if that was a rect object - if (!args.length && (arg.x != null || arg.l != null || arg.left != null)) { - args = [arg] - options = {} - } - - options = pick(arg, { - level: 'level maxLevel', - d: 'd diam diameter r radius px pxSize pixel pixelSize maxD size minSize', - lod: 'lod details ranges offsets' - }) - } - else { - options = {} - } - - if (!args.length) { args = bounds } - - var box = rect.apply( void 0, args ) - - var ref = [ - Math.min(box.x, box.x + box.width), - Math.min(box.y, box.y + box.height), - Math.max(box.x, box.x + box.width), - Math.max(box.y, box.y + box.height) + + var options + + if (isObj(args[args.length - 1])) { + var arg = args.pop() + + // detect if that was a rect object + if (!args.length && (arg.x != null || arg.l != null || arg.left != null)) { + args = [arg] + options = {} + } + + options = pick(arg, { + level: 'level maxLevel', + d: 'd diam diameter r radius px pxSize pixel pixelSize maxD size minSize', + lod: 'lod details ranges offsets' + }) + } + else { + options = {} + } + + if (!args.length) { args = bounds } + + var box = rect.apply( void 0, args ) + + var ref = [ + Math.min(box.x, box.x + box.width), + Math.min(box.y, box.y + box.height), + Math.max(box.x, box.x + box.width), + Math.max(box.y, box.y + box.height) ]; var minX = ref[0]; var minY = ref[1]; var maxX = ref[2]; - var maxY = ref[3]; - + var maxY = ref[3]; + var ref$1 = normalize([minX, minY, maxX, maxY], bounds ); var nminX = ref$1[0]; var nminY = ref$1[1]; var nmaxX = ref$1[2]; - var nmaxY = ref$1[3]; - - var maxLevel = defined(options.level, levels.length) - - // limit maxLevel by px size - if (options.d != null) { - var d - if (typeof options.d === 'number') { d = [options.d, options.d] } - else if (options.d.length) { d = options.d } - - maxLevel = Math.min( - Math.max( - Math.ceil(-log2(Math.abs(d[0]) / (bounds[2] - bounds[0]))), - Math.ceil(-log2(Math.abs(d[1]) / (bounds[3] - bounds[1]))) - ), - maxLevel - ) - } - maxLevel = Math.min(maxLevel, levels.length) - - // return levels of details - if (options.lod) { - return lod(nminX, nminY, nmaxX, nmaxY, maxLevel) - } - - - - // do selection ids - var selection = [] - - // FIXME: probably we can do LOD here beforehead - select( 0, 0, 1, 0, 0, 1) - - function select ( lox, loy, d, level, from, to ) { - if (from === null || to === null) { return } - - var hix = lox + d - var hiy = loy + d - - // if box does not intersect level - ignore - if ( nminX > hix || nminY > hiy || nmaxX < lox || nmaxY < loy ) { return } - if ( level >= maxLevel ) { return } - if ( from === to ) { return } - - // if points fall into box range - take it - var levelItems = levels[level] - - if (to === undefined) { to = levelItems.length } - - for (var i = from; i < to; i++) { - var id = levelItems[i] - - var px = srcPoints[ id * 2 ] - var py = srcPoints[ id * 2 + 1 ] - - if ( px >= minX && px <= maxX && py >= minY && py <= maxY ) {selection.push(id) - } - } - - // for every subsection do select - var offsets = sublevels[ level ] - var off0 = offsets[ from * 4 + 0 ] - var off1 = offsets[ from * 4 + 1 ] - var off2 = offsets[ from * 4 + 2 ] - var off3 = offsets[ from * 4 + 3 ] - var end = nextOffset(offsets, from + 1) - - var d2 = d * .5 - var nextLevel = level + 1 - select( lox, loy, d2, nextLevel, off0, off1 || off2 || off3 || end) - select( lox, loy + d2, d2, nextLevel, off1, off2 || off3 || end) - select( lox + d2, loy, d2, nextLevel, off2, off3 || end) - select( lox + d2, loy + d2, d2, nextLevel, off3, end) - } - - function nextOffset(offsets, from) { - var offset = null, i = 0 - while(offset === null) { - offset = offsets[ from * 4 + i ] - i++ - if (i > offsets.length) { return null } - } - return offset - } - - return selection - } - - // get range offsets within levels to render lods appropriate for zoom level - // TODO: it is possible to store minSize of a point to optimize neede level calc - function lod (lox, loy, hix, hiy, maxLevel) { - var ranges = [] - - for (var level = 0; level < maxLevel; level++) { - var levelGroups = groups[level] - var from = offsets[level][0] - - var levelGroupStart = group(lox, loy, level) - var levelGroupEnd = group(hix, hiy, level) - - // FIXME: utilize sublevels to speed up search range here - var startOffset = search.ge(levelGroups, levelGroupStart) - var endOffset = search.gt(levelGroups, levelGroupEnd, startOffset, levelGroups.length - 1) - - ranges[level] = [startOffset + from, endOffset + from] - } - - return ranges - } - - // get group id closest to the x,y coordinate, corresponding to a level - function group (x, y, level) { - var group = 1 - - var cx = .5, cy = .5 - var diam = .5 - - for (var i = 0; i < level; i++) { - group <<= 2 - - group += x < cx ? (y < cy ? 0 : 1) : (y < cy ? 2 : 3) - - diam *= .5 - - cx += x < cx ? -diam : diam - cy += y < cy ? -diam : diam - } - - return group - } -} - - -// normalize points by bounds -function normalize (pts, bounds) { + var nmaxY = ref$1[3]; + + var maxLevel = defined(options.level, levels.length) + + // limit maxLevel by px size + if (options.d != null) { + var d + if (typeof options.d === 'number') { d = [options.d, options.d] } + else if (options.d.length) { d = options.d } + + maxLevel = Math.min( + Math.max( + Math.ceil(-log2(Math.abs(d[0]) / (bounds[2] - bounds[0]))), + Math.ceil(-log2(Math.abs(d[1]) / (bounds[3] - bounds[1]))) + ), + maxLevel + ) + } + maxLevel = Math.min(maxLevel, levels.length) + + // return levels of details + if (options.lod) { + return lod(nminX, nminY, nmaxX, nmaxY, maxLevel) + } + + + + // do selection ids + var selection = [] + + // FIXME: probably we can do LOD here beforehead + select( 0, 0, 1, 0, 0, 1) + + function select ( lox, loy, d, level, from, to ) { + if (from === null || to === null) { return } + + var hix = lox + d + var hiy = loy + d + + // if box does not intersect level - ignore + if ( nminX > hix || nminY > hiy || nmaxX < lox || nmaxY < loy ) { return } + if ( level >= maxLevel ) { return } + if ( from === to ) { return } + + // if points fall into box range - take it + var levelItems = levels[level] + + if (to === undefined) { to = levelItems.length } + + for (var i = from; i < to; i++) { + var id = levelItems[i] + + var px = srcPoints[ id * 2 ] + var py = srcPoints[ id * 2 + 1 ] + + if ( px >= minX && px <= maxX && py >= minY && py <= maxY ) {selection.push(id) + } + } + + // for every subsection do select + var offsets = sublevels[ level ] + var off0 = offsets[ from * 4 + 0 ] + var off1 = offsets[ from * 4 + 1 ] + var off2 = offsets[ from * 4 + 2 ] + var off3 = offsets[ from * 4 + 3 ] + var end = nextOffset(offsets, from + 1) + + var d2 = d * .5 + var nextLevel = level + 1 + select( lox, loy, d2, nextLevel, off0, off1 || off2 || off3 || end) + select( lox, loy + d2, d2, nextLevel, off1, off2 || off3 || end) + select( lox + d2, loy, d2, nextLevel, off2, off3 || end) + select( lox + d2, loy + d2, d2, nextLevel, off3, end) + } + + function nextOffset(offsets, from) { + var offset = null, i = 0 + while(offset === null) { + offset = offsets[ from * 4 + i ] + i++ + if (i > offsets.length) { return null } + } + return offset + } + + return selection + } + + // get range offsets within levels to render lods appropriate for zoom level + // TODO: it is possible to store minSize of a point to optimize neede level calc + function lod (lox, loy, hix, hiy, maxLevel) { + var ranges = [] + + for (var level = 0; level < maxLevel; level++) { + var levelGroups = groups[level] + var from = offsets[level][0] + + var levelGroupStart = group(lox, loy, level) + var levelGroupEnd = group(hix, hiy, level) + + // FIXME: utilize sublevels to speed up search range here + var startOffset = search.ge(levelGroups, levelGroupStart) + var endOffset = search.gt(levelGroups, levelGroupEnd, startOffset, levelGroups.length - 1) + + ranges[level] = [startOffset + from, endOffset + from] + } + + return ranges + } + + // get group id closest to the x,y coordinate, corresponding to a level + function group (x, y, level) { + var group = 1 + + var cx = .5, cy = .5 + var diam = .5 + + for (var i = 0; i < level; i++) { + group <<= 2 + + group += x < cx ? (y < cy ? 0 : 1) : (y < cy ? 2 : 3) + + diam *= .5 + + cx += x < cx ? -diam : diam + cy += y < cy ? -diam : diam + } + + return group + } +} + + +// normalize points by bounds +function normalize (pts, bounds) { var lox = bounds[0]; var loy = bounds[1]; var hix = bounds[2]; - var hiy = bounds[3]; - var scaleX = 1.0 / (hix - lox) - var scaleY = 1.0 / (hiy - loy) - var result = new Array(pts.length) - - for (var i = 0, n = pts.length / 2; i < n; i++) { - result[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1) - result[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1) - } - - return result -} + var hiy = bounds[3]; + var scaleX = 1.0 / (hix - lox) + var scaleY = 1.0 / (hiy - loy) + var result = new Array(pts.length) + + for (var i = 0, n = pts.length / 2; i < n; i++) { + result[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1) + result[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1) + } + + return result +} },{"array-bounds":65,"binary-search-bounds":470,"clamp":115,"defined":164,"dtype":169,"flatten-vertex-data":227,"is-obj":421,"math-log2":432,"parse-rect":459,"pick-by-alias":465}],472:[function(_dereq_,module,exports){ module.exports = preprocessPolygon @@ -70238,361 +70238,361 @@ module.exports = reglScatter2d; },{"array-bounds":65,"color-id":118,"color-normalize":120,"flatten-vertex-data":227,"glslify":409,"is-iexplorer":419,"object-assign":454,"parse-rect":459,"pick-by-alias":465,"point-cluster":499,"to-float32":538,"update-diff":549}],498:[function(_dereq_,module,exports){ arguments[4][111][0].apply(exports,arguments) },{"dup":111}],499:[function(_dereq_,module,exports){ -'use strict' - -module.exports = _dereq_('./quad') +'use strict' + +module.exports = _dereq_('./quad') },{"./quad":500}],500:[function(_dereq_,module,exports){ -/** - * @module point-cluster/quad - * - * Bucket based quad tree clustering - */ - -'use strict' - -var search = _dereq_('binary-search-bounds') -var clamp = _dereq_('clamp') -var rect = _dereq_('parse-rect') -var getBounds = _dereq_('array-bounds') -var pick = _dereq_('pick-by-alias') -var defined = _dereq_('defined') -var flatten = _dereq_('flatten-vertex-data') -var isObj = _dereq_('is-obj') -var dtype = _dereq_('dtype') -var log2 = _dereq_('math-log2') - -var MAX_GROUP_ID = 1073741824 - -module.exports = function cluster (srcPoints, options) { - if (!options) { options = {} } - - srcPoints = flatten(srcPoints, 'float64') - - options = pick(options, { - bounds: 'range bounds dataBox databox', - maxDepth: 'depth maxDepth maxdepth level maxLevel maxlevel levels', - dtype: 'type dtype format out dst output destination' - // sort: 'sortBy sortby sort', - // pick: 'pick levelPoint', - // nodeSize: 'node nodeSize minNodeSize minSize size' - }) - - // let nodeSize = defined(options.nodeSize, 1) - var maxDepth = defined(options.maxDepth, 255) - var bounds = defined(options.bounds, getBounds(srcPoints, 2)) - if (bounds[0] === bounds[2]) { bounds[2]++ } - if (bounds[1] === bounds[3]) { bounds[3]++ } - - var points = normalize(srcPoints, bounds) - - // init variables - var n = srcPoints.length >>> 1 - var ids - if (!options.dtype) { options.dtype = 'array' } - - if (typeof options.dtype === 'string') { - ids = new (dtype(options.dtype))(n) - } - else if (options.dtype) { - ids = options.dtype - if (Array.isArray(ids)) { ids.length = n } - } - for (var i = 0; i < n; ++i) { - ids[i] = i - } - - // representative point indexes for levels - var levels = [] - - // starting indexes of subranges in sub levels, levels.length * 4 - var sublevels = [] - - // unique group ids, sorted in z-curve fashion within levels by shifting bits - var groups = [] - - // level offsets in `ids` - var offsets = [] - - - // sort points - sort(0, 0, 1, ids, 0, 1) - - - // return reordered ids with provided methods - // save level offsets in output buffer - var offset = 0 - for (var level = 0; level < levels.length; level++) { - var levelItems = levels[level] - if (ids.set) { ids.set(levelItems, offset) } - else { - for (var i$1 = 0, l = levelItems.length; i$1 < l; i$1++) { - ids[i$1 + offset] = levelItems[i$1] - } - } - var nextOffset = offset + levels[level].length - offsets[level] = [offset, nextOffset] - offset = nextOffset - } - - ids.range = range - - return ids - - - - // FIXME: it is possible to create one typed array heap and reuse that to avoid memory blow - function sort (x, y, diam, ids, level, group) { - if (!ids.length) { return null } - - // save first point as level representative - var levelItems = levels[level] || (levels[level] = []) - var levelGroups = groups[level] || (groups[level] = []) - var sublevel = sublevels[level] || (sublevels[level] = []) - var offset = levelItems.length - - level++ - - // max depth reached - put all items into a first group - // alternatively - if group id overflow - avoid proceeding - if (level > maxDepth || group > MAX_GROUP_ID) { - for (var i = 0; i < ids.length; i++) { - levelItems.push(ids[i]) - levelGroups.push(group) - sublevel.push(null, null, null, null) - } - - return offset - } - - levelItems.push(ids[0]) - levelGroups.push(group) - - if (ids.length <= 1) { - sublevel.push(null, null, null, null) - return offset - } - - - var d2 = diam * .5 - var cx = x + d2, cy = y + d2 - - // distribute points by 4 buckets - var lolo = [], lohi = [], hilo = [], hihi = [] - - for (var i$1 = 1, l = ids.length; i$1 < l; i$1++) { - var idx = ids[i$1], - x$1 = points[idx * 2], - y$1 = points[idx * 2 + 1] - x$1 < cx ? (y$1 < cy ? lolo.push(idx) : lohi.push(idx)) : (y$1 < cy ? hilo.push(idx) : hihi.push(idx)) - } - - group <<= 2 - - sublevel.push( - sort(x, y, d2, lolo, level, group), - sort(x, cy, d2, lohi, level, group + 1), - sort(cx, y, d2, hilo, level, group + 2), - sort(cx, cy, d2, hihi, level, group + 3) - ) - - return offset - } - - // get all points within the passed range +/** + * @module point-cluster/quad + * + * Bucket based quad tree clustering + */ + +'use strict' + +var search = _dereq_('binary-search-bounds') +var clamp = _dereq_('clamp') +var rect = _dereq_('parse-rect') +var getBounds = _dereq_('array-bounds') +var pick = _dereq_('pick-by-alias') +var defined = _dereq_('defined') +var flatten = _dereq_('flatten-vertex-data') +var isObj = _dereq_('is-obj') +var dtype = _dereq_('dtype') +var log2 = _dereq_('math-log2') + +var MAX_GROUP_ID = 1073741824 + +module.exports = function cluster (srcPoints, options) { + if (!options) { options = {} } + + srcPoints = flatten(srcPoints, 'float64') + + options = pick(options, { + bounds: 'range bounds dataBox databox', + maxDepth: 'depth maxDepth maxdepth level maxLevel maxlevel levels', + dtype: 'type dtype format out dst output destination' + // sort: 'sortBy sortby sort', + // pick: 'pick levelPoint', + // nodeSize: 'node nodeSize minNodeSize minSize size' + }) + + // let nodeSize = defined(options.nodeSize, 1) + var maxDepth = defined(options.maxDepth, 255) + var bounds = defined(options.bounds, getBounds(srcPoints, 2)) + if (bounds[0] === bounds[2]) { bounds[2]++ } + if (bounds[1] === bounds[3]) { bounds[3]++ } + + var points = normalize(srcPoints, bounds) + + // init variables + var n = srcPoints.length >>> 1 + var ids + if (!options.dtype) { options.dtype = 'array' } + + if (typeof options.dtype === 'string') { + ids = new (dtype(options.dtype))(n) + } + else if (options.dtype) { + ids = options.dtype + if (Array.isArray(ids)) { ids.length = n } + } + for (var i = 0; i < n; ++i) { + ids[i] = i + } + + // representative point indexes for levels + var levels = [] + + // starting indexes of subranges in sub levels, levels.length * 4 + var sublevels = [] + + // unique group ids, sorted in z-curve fashion within levels by shifting bits + var groups = [] + + // level offsets in `ids` + var offsets = [] + + + // sort points + sort(0, 0, 1, ids, 0, 1) + + + // return reordered ids with provided methods + // save level offsets in output buffer + var offset = 0 + for (var level = 0; level < levels.length; level++) { + var levelItems = levels[level] + if (ids.set) { ids.set(levelItems, offset) } + else { + for (var i$1 = 0, l = levelItems.length; i$1 < l; i$1++) { + ids[i$1 + offset] = levelItems[i$1] + } + } + var nextOffset = offset + levels[level].length + offsets[level] = [offset, nextOffset] + offset = nextOffset + } + + ids.range = range + + return ids + + + + // FIXME: it is possible to create one typed array heap and reuse that to avoid memory blow + function sort (x, y, diam, ids, level, group) { + if (!ids.length) { return null } + + // save first point as level representative + var levelItems = levels[level] || (levels[level] = []) + var levelGroups = groups[level] || (groups[level] = []) + var sublevel = sublevels[level] || (sublevels[level] = []) + var offset = levelItems.length + + level++ + + // max depth reached - put all items into a first group + // alternatively - if group id overflow - avoid proceeding + if (level > maxDepth || group > MAX_GROUP_ID) { + for (var i = 0; i < ids.length; i++) { + levelItems.push(ids[i]) + levelGroups.push(group) + sublevel.push(null, null, null, null) + } + + return offset + } + + levelItems.push(ids[0]) + levelGroups.push(group) + + if (ids.length <= 1) { + sublevel.push(null, null, null, null) + return offset + } + + + var d2 = diam * .5 + var cx = x + d2, cy = y + d2 + + // distribute points by 4 buckets + var lolo = [], lohi = [], hilo = [], hihi = [] + + for (var i$1 = 1, l = ids.length; i$1 < l; i$1++) { + var idx = ids[i$1], + x$1 = points[idx * 2], + y$1 = points[idx * 2 + 1] + x$1 < cx ? (y$1 < cy ? lolo.push(idx) : lohi.push(idx)) : (y$1 < cy ? hilo.push(idx) : hihi.push(idx)) + } + + group <<= 2 + + sublevel.push( + sort(x, y, d2, lolo, level, group), + sort(x, cy, d2, lohi, level, group + 1), + sort(cx, y, d2, hilo, level, group + 2), + sort(cx, cy, d2, hihi, level, group + 3) + ) + + return offset + } + + // get all points within the passed range function range () { var args = [], len = arguments.length; while ( len-- ) args[ len ] = arguments[ len ]; - - var options - - if (isObj(args[args.length - 1])) { - var arg = args.pop() - - // detect if that was a rect object - if (!args.length && (arg.x != null || arg.l != null || arg.left != null)) { - args = [arg] - options = {} - } - - options = pick(arg, { - level: 'level maxLevel', - d: 'd diam diameter r radius px pxSize pixel pixelSize maxD size minSize', - lod: 'lod details ranges offsets' - }) - } - else { - options = {} - } - - if (!args.length) { args = bounds } - - var box = rect.apply( void 0, args ) - - var ref = [ - Math.min(box.x, box.x + box.width), - Math.min(box.y, box.y + box.height), - Math.max(box.x, box.x + box.width), - Math.max(box.y, box.y + box.height) + + var options + + if (isObj(args[args.length - 1])) { + var arg = args.pop() + + // detect if that was a rect object + if (!args.length && (arg.x != null || arg.l != null || arg.left != null)) { + args = [arg] + options = {} + } + + options = pick(arg, { + level: 'level maxLevel', + d: 'd diam diameter r radius px pxSize pixel pixelSize maxD size minSize', + lod: 'lod details ranges offsets' + }) + } + else { + options = {} + } + + if (!args.length) { args = bounds } + + var box = rect.apply( void 0, args ) + + var ref = [ + Math.min(box.x, box.x + box.width), + Math.min(box.y, box.y + box.height), + Math.max(box.x, box.x + box.width), + Math.max(box.y, box.y + box.height) ]; var minX = ref[0]; var minY = ref[1]; var maxX = ref[2]; - var maxY = ref[3]; - + var maxY = ref[3]; + var ref$1 = normalize([minX, minY, maxX, maxY], bounds ); var nminX = ref$1[0]; var nminY = ref$1[1]; var nmaxX = ref$1[2]; - var nmaxY = ref$1[3]; - - var maxLevel = defined(options.level, levels.length) - - // limit maxLevel by px size - if (options.d != null) { - var d - if (typeof options.d === 'number') { d = [options.d, options.d] } - else if (options.d.length) { d = options.d } - - maxLevel = Math.min( - Math.max( - Math.ceil(-log2(Math.abs(d[0]) / (bounds[2] - bounds[0]))), - Math.ceil(-log2(Math.abs(d[1]) / (bounds[3] - bounds[1]))) - ), - maxLevel - ) - } - maxLevel = Math.min(maxLevel, levels.length) - - // return levels of details - if (options.lod) { - return lod(nminX, nminY, nmaxX, nmaxY, maxLevel) - } - - - - // do selection ids - var selection = [] - - // FIXME: probably we can do LOD here beforehead - select( 0, 0, 1, 0, 0, 1) - - function select ( lox, loy, d, level, from, to ) { - if (from === null || to === null) { return } - - var hix = lox + d - var hiy = loy + d - - // if box does not intersect level - ignore - if ( nminX > hix || nminY > hiy || nmaxX < lox || nmaxY < loy ) { return } - if ( level >= maxLevel ) { return } - if ( from === to ) { return } - - // if points fall into box range - take it - var levelItems = levels[level] - - if (to === undefined) { to = levelItems.length } - - for (var i = from; i < to; i++) { - var id = levelItems[i] - - var px = srcPoints[ id * 2 ] - var py = srcPoints[ id * 2 + 1 ] - - if ( px >= minX && px <= maxX && py >= minY && py <= maxY ) {selection.push(id) - } - } - - // for every subsection do select - var offsets = sublevels[ level ] - var off0 = offsets[ from * 4 + 0 ] - var off1 = offsets[ from * 4 + 1 ] - var off2 = offsets[ from * 4 + 2 ] - var off3 = offsets[ from * 4 + 3 ] - var end = nextOffset(offsets, from + 1) - - var d2 = d * .5 - var nextLevel = level + 1 - select( lox, loy, d2, nextLevel, off0, off1 || off2 || off3 || end) - select( lox, loy + d2, d2, nextLevel, off1, off2 || off3 || end) - select( lox + d2, loy, d2, nextLevel, off2, off3 || end) - select( lox + d2, loy + d2, d2, nextLevel, off3, end) - } - - function nextOffset(offsets, from) { - var offset = null, i = 0 - while(offset === null) { - offset = offsets[ from * 4 + i ] - i++ - if (i > offsets.length) { return null } - } - return offset - } - - return selection - } - - // get range offsets within levels to render lods appropriate for zoom level - // TODO: it is possible to store minSize of a point to optimize neede level calc - function lod (lox, loy, hix, hiy, maxLevel) { - var ranges = [] - - for (var level = 0; level < maxLevel; level++) { - var levelGroups = groups[level] - var from = offsets[level][0] - - var levelGroupStart = group(lox, loy, level) - var levelGroupEnd = group(hix, hiy, level) - - // FIXME: utilize sublevels to speed up search range here - var startOffset = search.ge(levelGroups, levelGroupStart) - var endOffset = search.gt(levelGroups, levelGroupEnd, startOffset, levelGroups.length - 1) - - ranges[level] = [startOffset + from, endOffset + from] - } - - return ranges - } - - // get group id closest to the x,y coordinate, corresponding to a level - function group (x, y, level) { - var group = 1 - - var cx = .5, cy = .5 - var diam = .5 - - for (var i = 0; i < level; i++) { - group <<= 2 - - group += x < cx ? (y < cy ? 0 : 1) : (y < cy ? 2 : 3) - - diam *= .5 - - cx += x < cx ? -diam : diam - cy += y < cy ? -diam : diam - } - - return group - } -} - - -// normalize points by bounds -function normalize (pts, bounds) { + var nmaxY = ref$1[3]; + + var maxLevel = defined(options.level, levels.length) + + // limit maxLevel by px size + if (options.d != null) { + var d + if (typeof options.d === 'number') { d = [options.d, options.d] } + else if (options.d.length) { d = options.d } + + maxLevel = Math.min( + Math.max( + Math.ceil(-log2(Math.abs(d[0]) / (bounds[2] - bounds[0]))), + Math.ceil(-log2(Math.abs(d[1]) / (bounds[3] - bounds[1]))) + ), + maxLevel + ) + } + maxLevel = Math.min(maxLevel, levels.length) + + // return levels of details + if (options.lod) { + return lod(nminX, nminY, nmaxX, nmaxY, maxLevel) + } + + + + // do selection ids + var selection = [] + + // FIXME: probably we can do LOD here beforehead + select( 0, 0, 1, 0, 0, 1) + + function select ( lox, loy, d, level, from, to ) { + if (from === null || to === null) { return } + + var hix = lox + d + var hiy = loy + d + + // if box does not intersect level - ignore + if ( nminX > hix || nminY > hiy || nmaxX < lox || nmaxY < loy ) { return } + if ( level >= maxLevel ) { return } + if ( from === to ) { return } + + // if points fall into box range - take it + var levelItems = levels[level] + + if (to === undefined) { to = levelItems.length } + + for (var i = from; i < to; i++) { + var id = levelItems[i] + + var px = srcPoints[ id * 2 ] + var py = srcPoints[ id * 2 + 1 ] + + if ( px >= minX && px <= maxX && py >= minY && py <= maxY ) {selection.push(id) + } + } + + // for every subsection do select + var offsets = sublevels[ level ] + var off0 = offsets[ from * 4 + 0 ] + var off1 = offsets[ from * 4 + 1 ] + var off2 = offsets[ from * 4 + 2 ] + var off3 = offsets[ from * 4 + 3 ] + var end = nextOffset(offsets, from + 1) + + var d2 = d * .5 + var nextLevel = level + 1 + select( lox, loy, d2, nextLevel, off0, off1 || off2 || off3 || end) + select( lox, loy + d2, d2, nextLevel, off1, off2 || off3 || end) + select( lox + d2, loy, d2, nextLevel, off2, off3 || end) + select( lox + d2, loy + d2, d2, nextLevel, off3, end) + } + + function nextOffset(offsets, from) { + var offset = null, i = 0 + while(offset === null) { + offset = offsets[ from * 4 + i ] + i++ + if (i > offsets.length) { return null } + } + return offset + } + + return selection + } + + // get range offsets within levels to render lods appropriate for zoom level + // TODO: it is possible to store minSize of a point to optimize neede level calc + function lod (lox, loy, hix, hiy, maxLevel) { + var ranges = [] + + for (var level = 0; level < maxLevel; level++) { + var levelGroups = groups[level] + var from = offsets[level][0] + + var levelGroupStart = group(lox, loy, level) + var levelGroupEnd = group(hix, hiy, level) + + // FIXME: utilize sublevels to speed up search range here + var startOffset = search.ge(levelGroups, levelGroupStart) + var endOffset = search.gt(levelGroups, levelGroupEnd, startOffset, levelGroups.length - 1) + + ranges[level] = [startOffset + from, endOffset + from] + } + + return ranges + } + + // get group id closest to the x,y coordinate, corresponding to a level + function group (x, y, level) { + var group = 1 + + var cx = .5, cy = .5 + var diam = .5 + + for (var i = 0; i < level; i++) { + group <<= 2 + + group += x < cx ? (y < cy ? 0 : 1) : (y < cy ? 2 : 3) + + diam *= .5 + + cx += x < cx ? -diam : diam + cy += y < cy ? -diam : diam + } + + return group + } +} + + +// normalize points by bounds +function normalize (pts, bounds) { var lox = bounds[0]; var loy = bounds[1]; var hix = bounds[2]; - var hiy = bounds[3]; - var scaleX = 1.0 / (hix - lox) - var scaleY = 1.0 / (hiy - loy) - var result = new Array(pts.length) - - for (var i = 0, n = pts.length / 2; i < n; i++) { - result[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1) - result[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1) - } - - return result -} + var hiy = bounds[3]; + var scaleX = 1.0 / (hix - lox) + var scaleY = 1.0 / (hiy - loy) + var result = new Array(pts.length) + + for (var i = 0, n = pts.length / 2; i < n; i++) { + result[2*i] = clamp((pts[2*i] - lox) * scaleX, 0, 1) + result[2*i+1] = clamp((pts[2*i+1] - loy) * scaleY, 0, 1) + } + + return result +} },{"array-bounds":65,"binary-search-bounds":498,"clamp":115,"defined":164,"dtype":169,"flatten-vertex-data":227,"is-obj":421,"math-log2":432,"parse-rect":459,"pick-by-alias":465}],501:[function(_dereq_,module,exports){ 'use strict' @@ -73892,62 +73892,62 @@ function negative(points, plane) { }(); // eslint-disable-line },{}],529:[function(_dereq_,module,exports){ -'use strict' - -var paren = _dereq_('parenthesis') - -module.exports = function splitBy (string, separator, o) { - if (string == null) throw Error('First argument should be a string') - if (separator == null) throw Error('Separator should be a string or a RegExp') - - if (!o) o = {} - else if (typeof o === 'string' || Array.isArray(o)) { - o = {ignore: o} - } - - if (o.escape == null) o.escape = true - if (o.ignore == null) o.ignore = ['[]', '()', '{}', '<>', '""', "''", '``', '“”', '«»'] - else { - if (typeof o.ignore === 'string') {o.ignore = [o.ignore]} - - o.ignore = o.ignore.map(function (pair) { - // '"' → '""' - if (pair.length === 1) pair = pair + pair - return pair - }) - } - - var tokens = paren.parse(string, {flat: true, brackets: o.ignore}) - var str = tokens[0] - - var parts = str.split(separator) - - // join parts separated by escape - if (o.escape) { - var cleanParts = [] - for (var i = 0; i < parts.length; i++) { - var prev = parts[i] - var part = parts[i + 1] - - if (prev[prev.length - 1] === '\\' && prev[prev.length - 2] !== '\\') { - cleanParts.push(prev + separator + part) - i++ - } - else { - cleanParts.push(prev) - } - } - parts = cleanParts - } - - // open parens pack & apply unquotes, if any - for (var i = 0; i < parts.length; i++) { - tokens[0] = parts[i] - parts[i] = paren.stringify(tokens, {flat: true}) - } - - return parts -} +'use strict' + +var paren = _dereq_('parenthesis') + +module.exports = function splitBy (string, separator, o) { + if (string == null) throw Error('First argument should be a string') + if (separator == null) throw Error('Separator should be a string or a RegExp') + + if (!o) o = {} + else if (typeof o === 'string' || Array.isArray(o)) { + o = {ignore: o} + } + + if (o.escape == null) o.escape = true + if (o.ignore == null) o.ignore = ['[]', '()', '{}', '<>', '""', "''", '``', '“”', '«»'] + else { + if (typeof o.ignore === 'string') {o.ignore = [o.ignore]} + + o.ignore = o.ignore.map(function (pair) { + // '"' → '""' + if (pair.length === 1) pair = pair + pair + return pair + }) + } + + var tokens = paren.parse(string, {flat: true, brackets: o.ignore}) + var str = tokens[0] + + var parts = str.split(separator) + + // join parts separated by escape + if (o.escape) { + var cleanParts = [] + for (var i = 0; i < parts.length; i++) { + var prev = parts[i] + var part = parts[i + 1] + + if (prev[prev.length - 1] === '\\' && prev[prev.length - 2] !== '\\') { + cleanParts.push(prev + separator + part) + i++ + } + else { + cleanParts.push(prev) + } + } + parts = cleanParts + } + + // open parens pack & apply unquotes, if any + for (var i = 0; i < parts.length; i++) { + tokens[0] = parts[i] + parts[i] = paren.stringify(tokens, {flat: true}) + } + + return parts +} },{"parenthesis":458}],530:[function(_dereq_,module,exports){ "use strict" @@ -74470,276 +74470,276 @@ var arcToBezier = function arcToBezier(_ref2) { exports.default = arcToBezier; module.exports = exports.default; },{}],533:[function(_dereq_,module,exports){ -'use strict' - -var parse = _dereq_('parse-svg-path') -var abs = _dereq_('abs-svg-path') -var normalize = _dereq_('normalize-svg-path') -var isSvgPath = _dereq_('is-svg-path') -var assert = _dereq_('assert') - -module.exports = pathBounds - - -function pathBounds(path) { - // ES6 string tpl call - if (Array.isArray(path) && path.length === 1 && typeof path[0] === 'string') path = path[0] - - // svg path string - if (typeof path === 'string') { - assert(isSvgPath(path), 'String is not an SVG path.') - path = parse(path) - } - - assert(Array.isArray(path), 'Argument should be a string or an array of path segments.') - - path = abs(path) - path = normalize(path) - - if (!path.length) return [0, 0, 0, 0] - - var bounds = [Infinity, Infinity, -Infinity, -Infinity] - - for (var i = 0, l = path.length; i < l; i++) { - var points = path[i].slice(1) - - for (var j = 0; j < points.length; j += 2) { - if (points[j + 0] < bounds[0]) bounds[0] = points[j + 0] - if (points[j + 1] < bounds[1]) bounds[1] = points[j + 1] - if (points[j + 0] > bounds[2]) bounds[2] = points[j + 0] - if (points[j + 1] > bounds[3]) bounds[3] = points[j + 1] - } - } - - return bounds -} +'use strict' + +var parse = _dereq_('parse-svg-path') +var abs = _dereq_('abs-svg-path') +var normalize = _dereq_('normalize-svg-path') +var isSvgPath = _dereq_('is-svg-path') +var assert = _dereq_('assert') + +module.exports = pathBounds + + +function pathBounds(path) { + // ES6 string tpl call + if (Array.isArray(path) && path.length === 1 && typeof path[0] === 'string') path = path[0] + + // svg path string + if (typeof path === 'string') { + assert(isSvgPath(path), 'String is not an SVG path.') + path = parse(path) + } + + assert(Array.isArray(path), 'Argument should be a string or an array of path segments.') + + path = abs(path) + path = normalize(path) + + if (!path.length) return [0, 0, 0, 0] + + var bounds = [Infinity, Infinity, -Infinity, -Infinity] + + for (var i = 0, l = path.length; i < l; i++) { + var points = path[i].slice(1) + + for (var j = 0; j < points.length; j += 2) { + if (points[j + 0] < bounds[0]) bounds[0] = points[j + 0] + if (points[j + 1] < bounds[1]) bounds[1] = points[j + 1] + if (points[j + 0] > bounds[2]) bounds[2] = points[j + 0] + if (points[j + 1] > bounds[3]) bounds[3] = points[j + 1] + } + } + + return bounds +} },{"abs-svg-path":60,"assert":68,"is-svg-path":424,"normalize-svg-path":534,"parse-svg-path":460}],534:[function(_dereq_,module,exports){ -'use strict' - -module.exports = normalize - -var arcToCurve = _dereq_('svg-arc-to-cubic-bezier') - -function normalize(path){ - // init state - var prev - var result = [] - var bezierX = 0 - var bezierY = 0 - var startX = 0 - var startY = 0 - var quadX = null - var quadY = null - var x = 0 - var y = 0 - - for (var i = 0, len = path.length; i < len; i++) { - var seg = path[i] - var command = seg[0] - - switch (command) { - case 'M': - startX = seg[1] - startY = seg[2] - break - case 'A': - var curves = arcToCurve({ - px: x, - py: y, - cx: seg[6], - cy: seg[7], - rx: seg[1], - ry: seg[2], - xAxisRotation: seg[3], - largeArcFlag: seg[4], - sweepFlag: seg[5] - }) - - // null-curves - if (!curves.length) continue - - for (var j = 0, c; j < curves.length; j++) { - c = curves[j] - seg = ['C', c.x1, c.y1, c.x2, c.y2, c.x, c.y] - if (j < curves.length - 1) result.push(seg) - } - - break - case 'S': - // default control point - var cx = x - var cy = y - if (prev == 'C' || prev == 'S') { - cx += cx - bezierX // reflect the previous command's control - cy += cy - bezierY // point relative to the current point - } - seg = ['C', cx, cy, seg[1], seg[2], seg[3], seg[4]] - break - case 'T': - if (prev == 'Q' || prev == 'T') { - quadX = x * 2 - quadX // as with 'S' reflect previous control point - quadY = y * 2 - quadY - } else { - quadX = x - quadY = y - } - seg = quadratic(x, y, quadX, quadY, seg[1], seg[2]) - break - case 'Q': - quadX = seg[1] - quadY = seg[2] - seg = quadratic(x, y, seg[1], seg[2], seg[3], seg[4]) - break - case 'L': - seg = line(x, y, seg[1], seg[2]) - break - case 'H': - seg = line(x, y, seg[1], y) - break - case 'V': - seg = line(x, y, x, seg[1]) - break - case 'Z': - seg = line(x, y, startX, startY) - break - } - - // update state - prev = command - x = seg[seg.length - 2] - y = seg[seg.length - 1] - if (seg.length > 4) { - bezierX = seg[seg.length - 4] - bezierY = seg[seg.length - 3] - } else { - bezierX = x - bezierY = y - } - result.push(seg) - } - - return result -} - -function line(x1, y1, x2, y2){ - return ['C', x1, y1, x2, y2, x2, y2] -} - -function quadratic(x1, y1, cx, cy, x2, y2){ - return [ - 'C', - x1/3 + (2/3) * cx, - y1/3 + (2/3) * cy, - x2/3 + (2/3) * cx, - y2/3 + (2/3) * cy, - x2, - y2 - ] -} +'use strict' + +module.exports = normalize + +var arcToCurve = _dereq_('svg-arc-to-cubic-bezier') + +function normalize(path){ + // init state + var prev + var result = [] + var bezierX = 0 + var bezierY = 0 + var startX = 0 + var startY = 0 + var quadX = null + var quadY = null + var x = 0 + var y = 0 + + for (var i = 0, len = path.length; i < len; i++) { + var seg = path[i] + var command = seg[0] + + switch (command) { + case 'M': + startX = seg[1] + startY = seg[2] + break + case 'A': + var curves = arcToCurve({ + px: x, + py: y, + cx: seg[6], + cy: seg[7], + rx: seg[1], + ry: seg[2], + xAxisRotation: seg[3], + largeArcFlag: seg[4], + sweepFlag: seg[5] + }) + + // null-curves + if (!curves.length) continue + + for (var j = 0, c; j < curves.length; j++) { + c = curves[j] + seg = ['C', c.x1, c.y1, c.x2, c.y2, c.x, c.y] + if (j < curves.length - 1) result.push(seg) + } + + break + case 'S': + // default control point + var cx = x + var cy = y + if (prev == 'C' || prev == 'S') { + cx += cx - bezierX // reflect the previous command's control + cy += cy - bezierY // point relative to the current point + } + seg = ['C', cx, cy, seg[1], seg[2], seg[3], seg[4]] + break + case 'T': + if (prev == 'Q' || prev == 'T') { + quadX = x * 2 - quadX // as with 'S' reflect previous control point + quadY = y * 2 - quadY + } else { + quadX = x + quadY = y + } + seg = quadratic(x, y, quadX, quadY, seg[1], seg[2]) + break + case 'Q': + quadX = seg[1] + quadY = seg[2] + seg = quadratic(x, y, seg[1], seg[2], seg[3], seg[4]) + break + case 'L': + seg = line(x, y, seg[1], seg[2]) + break + case 'H': + seg = line(x, y, seg[1], y) + break + case 'V': + seg = line(x, y, x, seg[1]) + break + case 'Z': + seg = line(x, y, startX, startY) + break + } + + // update state + prev = command + x = seg[seg.length - 2] + y = seg[seg.length - 1] + if (seg.length > 4) { + bezierX = seg[seg.length - 4] + bezierY = seg[seg.length - 3] + } else { + bezierX = x + bezierY = y + } + result.push(seg) + } + + return result +} + +function line(x1, y1, x2, y2){ + return ['C', x1, y1, x2, y2, x2, y2] +} + +function quadratic(x1, y1, cx, cy, x2, y2){ + return [ + 'C', + x1/3 + (2/3) * cx, + y1/3 + (2/3) * cy, + x2/3 + (2/3) * cx, + y2/3 + (2/3) * cy, + x2, + y2 + ] +} },{"svg-arc-to-cubic-bezier":532}],535:[function(_dereq_,module,exports){ -'use strict' - -var pathBounds = _dereq_('svg-path-bounds') -var parsePath = _dereq_('parse-svg-path') -var drawPath = _dereq_('draw-svg-path') -var isSvgPath = _dereq_('is-svg-path') -var bitmapSdf = _dereq_('bitmap-sdf') - -var canvas = document.createElement('canvas') -var ctx = canvas.getContext('2d') - - -module.exports = pathSdf - - -function pathSdf (path, options) { - if (!isSvgPath(path)) throw Error('Argument should be valid svg path string') - - if (!options) options = {} - - var w, h - if (options.shape) { - w = options.shape[0] - h = options.shape[1] - } - else { - w = canvas.width = options.w || options.width || 200 - h = canvas.height = options.h || options.height || 200 - } - var size = Math.min(w, h) - - var stroke = options.stroke || 0 - - var viewbox = options.viewbox || options.viewBox || pathBounds(path) - var scale = [w / (viewbox[2] - viewbox[0]), h / (viewbox[3] - viewbox[1])] - var maxScale = Math.min(scale[0] || 0, scale[1] || 0) / 2 - - //clear ctx - ctx.fillStyle = 'black' - ctx.fillRect(0, 0, w, h) - - ctx.fillStyle = 'white' - - if (stroke) { - if (typeof stroke != 'number') stroke = 1 - if (stroke > 0) { - ctx.strokeStyle = 'white' - } - else { - ctx.strokeStyle = 'black' - } - - ctx.lineWidth = Math.abs(stroke) - } - - ctx.translate(w * .5, h * .5) - ctx.scale(maxScale, maxScale) - - //if canvas svg paths api is available - if (isPath2DSupported()) { - var path2d = new Path2D(path) - ctx.fill(path2d) - stroke && ctx.stroke(path2d) - } - //fallback to bezier-curves - else { - var segments = parsePath(path) - drawPath(ctx, segments) - ctx.fill() - stroke && ctx.stroke() - } - - ctx.setTransform(1, 0, 0, 1, 0, 0); - - var data = bitmapSdf(ctx, { - cutoff: options.cutoff != null ? options.cutoff : .5, - radius: options.radius != null ? options.radius : size * .5 - }) - - return data -} - -var path2DSupported - -function isPath2DSupported () { - if (path2DSupported != null) return path2DSupported - - var ctx = document.createElement('canvas').getContext('2d') - ctx.canvas.width = ctx.canvas.height = 1 - - if (!window.Path2D) return path2DSupported = false - - var path = new Path2D('M0,0h1v1h-1v-1Z') - - ctx.fillStyle = 'black' - ctx.fill(path) - - var idata = ctx.getImageData(0,0,1,1) - - return path2DSupported = idata && idata.data && idata.data[3] === 255 -} +'use strict' + +var pathBounds = _dereq_('svg-path-bounds') +var parsePath = _dereq_('parse-svg-path') +var drawPath = _dereq_('draw-svg-path') +var isSvgPath = _dereq_('is-svg-path') +var bitmapSdf = _dereq_('bitmap-sdf') + +var canvas = document.createElement('canvas') +var ctx = canvas.getContext('2d') + + +module.exports = pathSdf + + +function pathSdf (path, options) { + if (!isSvgPath(path)) throw Error('Argument should be valid svg path string') + + if (!options) options = {} + + var w, h + if (options.shape) { + w = options.shape[0] + h = options.shape[1] + } + else { + w = canvas.width = options.w || options.width || 200 + h = canvas.height = options.h || options.height || 200 + } + var size = Math.min(w, h) + + var stroke = options.stroke || 0 + + var viewbox = options.viewbox || options.viewBox || pathBounds(path) + var scale = [w / (viewbox[2] - viewbox[0]), h / (viewbox[3] - viewbox[1])] + var maxScale = Math.min(scale[0] || 0, scale[1] || 0) / 2 + + //clear ctx + ctx.fillStyle = 'black' + ctx.fillRect(0, 0, w, h) + + ctx.fillStyle = 'white' + + if (stroke) { + if (typeof stroke != 'number') stroke = 1 + if (stroke > 0) { + ctx.strokeStyle = 'white' + } + else { + ctx.strokeStyle = 'black' + } + + ctx.lineWidth = Math.abs(stroke) + } + + ctx.translate(w * .5, h * .5) + ctx.scale(maxScale, maxScale) + + //if canvas svg paths api is available + if (isPath2DSupported()) { + var path2d = new Path2D(path) + ctx.fill(path2d) + stroke && ctx.stroke(path2d) + } + //fallback to bezier-curves + else { + var segments = parsePath(path) + drawPath(ctx, segments) + ctx.fill() + stroke && ctx.stroke() + } + + ctx.setTransform(1, 0, 0, 1, 0, 0); + + var data = bitmapSdf(ctx, { + cutoff: options.cutoff != null ? options.cutoff : .5, + radius: options.radius != null ? options.radius : size * .5 + }) + + return data +} + +var path2DSupported + +function isPath2DSupported () { + if (path2DSupported != null) return path2DSupported + + var ctx = document.createElement('canvas').getContext('2d') + ctx.canvas.width = ctx.canvas.height = 1 + + if (!window.Path2D) return path2DSupported = false + + var path = new Path2D('M0,0h1v1h-1v-1Z') + + ctx.fillStyle = 'black' + ctx.fill(path) + + var idata = ctx.getImageData(0,0,1,1) + + return path2DSupported = idata && idata.data && idata.data[3] === 255 +} },{"bitmap-sdf":93,"draw-svg-path":168,"is-svg-path":424,"parse-svg-path":460,"svg-path-bounds":533}],536:[function(_dereq_,module,exports){ (function (process){ @@ -76036,45 +76036,45 @@ else { })(Math); },{}],538:[function(_dereq_,module,exports){ -/* @module to-float32 */ - -'use strict' - -module.exports = float32 -module.exports.float32 = -module.exports.float = float32 -module.exports.fract32 = -module.exports.fract = fract32 - -var narr = new Float32Array(1) - -// return fractional part of float32 array -function fract32 (arr) { - if (arr.length) { - var fract = float32(arr) - for (var i = 0, l = fract.length; i < l; i++) { - fract[i] = arr[i] - fract[i] - } - return fract - } - - // number - return float32(arr - float32(arr)) -} - -// make sure data is float32 array -function float32 (arr) { - if (arr.length) { - if (arr instanceof Float32Array) return arr - var float = new Float32Array(arr) - float.set(arr) - return float - } - - // number - narr[0] = arr - return narr[0] -} +/* @module to-float32 */ + +'use strict' + +module.exports = float32 +module.exports.float32 = +module.exports.float = float32 +module.exports.fract32 = +module.exports.fract = fract32 + +var narr = new Float32Array(1) + +// return fractional part of float32 array +function fract32 (arr) { + if (arr.length) { + var fract = float32(arr) + for (var i = 0, l = fract.length; i < l; i++) { + fract[i] = arr[i] - fract[i] + } + return fract + } + + // number + return float32(arr - float32(arr)) +} + +// make sure data is float32 array +function float32 (arr) { + if (arr.length) { + if (arr instanceof Float32Array) return arr + var float = new Float32Array(arr) + float.set(arr) + return float + } + + // number + narr[0] = arr + return narr[0] +} },{}],539:[function(_dereq_,module,exports){ 'use strict' @@ -77672,37 +77672,37 @@ module.exports = function unquote(str) { } },{}],549:[function(_dereq_,module,exports){ -/** - * @module update-diff - */ - -'use strict' - -module.exports = function updateDiff (obj, diff, mappers) { - if (!Array.isArray(mappers)) mappers = [].slice.call(arguments, 2) - - for (var i = 0, l = mappers.length; i < l; i++) { - var dict = mappers[i] - for (var prop in dict) { - if (diff[prop] !== undefined && !Array.isArray(diff[prop]) && obj[prop] === diff[prop]) continue - - if (prop in diff) { - var result - - if (dict[prop] === true) result = diff[prop] - else if (dict[prop] === false) continue - else if (typeof dict[prop] === 'function') { - result = dict[prop](diff[prop], obj, diff) - if (result === undefined) continue - } - - obj[prop] = result - } - } - } - - return obj -} +/** + * @module update-diff + */ + +'use strict' + +module.exports = function updateDiff (obj, diff, mappers) { + if (!Array.isArray(mappers)) mappers = [].slice.call(arguments, 2) + + for (var i = 0, l = mappers.length; i < l; i++) { + var dict = mappers[i] + for (var prop in dict) { + if (diff[prop] !== undefined && !Array.isArray(diff[prop]) && obj[prop] === diff[prop]) continue + + if (prop in diff) { + var result + + if (dict[prop] === true) result = diff[prop] + else if (dict[prop] === false) continue + else if (typeof dict[prop] === 'function') { + result = dict[prop](diff[prop], obj, diff) + if (result === undefined) continue + } + + obj[prop] = result + } + } + } + + return obj +} },{}],550:[function(_dereq_,module,exports){ "use strict" From 8a76d6e3bc55ae034b1128444faeb9587c36ba7b Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 12:46:34 +0200 Subject: [PATCH 2/7] [TASK] add possibility to attach data in moreInfo in sankey links and node --- dist/plotly.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dist/plotly.js b/dist/plotly.js index e4f49766155..d0ca20e951c 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -179621,6 +179621,10 @@ var attrs = module.exports = overrideAll({ keys: ['value', 'label'] }), + moreInfo: { + valType: 'data_array', + dflt: [], + }, }, @@ -179671,6 +179675,10 @@ var attrs = module.exports = overrideAll({ dflt: [], + }, + moreInfo: { + valType: 'data_array', + dflt: [], }, hoverinfo: { valType: 'enumerated', @@ -180119,6 +180127,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerceNode('hoverinfo', traceIn.hoverinfo); handleHoverLabelDefaults(nodeIn, nodeOut, coerceNode, hoverlabelDefault); coerceNode('hovertemplate'); + coerceNode('moreInfo'); var colors = layout.colorway; @@ -180141,6 +180150,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerceLink('value'); coerceLink('line.color'); coerceLink('line.width'); + coerceLink('moreInfo'); coerceLink('hoverinfo', traceIn.hoverinfo); handleHoverLabelDefaults(linkIn, linkOut, coerceLink, hoverlabelDefault); coerceLink('hovertemplate'); @@ -180880,6 +180890,7 @@ function linkModel(d, l, i) { // for event data l.trace = d.trace; l.curveNumber = d.trace.index; + l.moreInfo = d.trace.link.moreInfo[i]; return { circular: d.circular, @@ -181067,6 +181078,7 @@ function nodeModel(d, n) { // for event data n.trace = d.trace; n.curveNumber = d.trace.index; + n.moreInfo = d.trace.node.moreInfo[n.pointNumber]; return { index: n.pointNumber, From 40b73e94b715fc4d2589c7ff84511cccd42b2c68 Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 12:51:13 +0200 Subject: [PATCH 3/7] [TASK] add possibility to attach data in moreInfo in sankey links and node changes in src files now --- src/traces/sankey/attributes.js | 8 ++++++++ src/traces/sankey/defaults.js | 2 ++ src/traces/sankey/render.js | 2 ++ 3 files changed, 12 insertions(+) diff --git a/src/traces/sankey/attributes.js b/src/traces/sankey/attributes.js index a3501323cf9..0408eaedec4 100644 --- a/src/traces/sankey/attributes.js +++ b/src/traces/sankey/attributes.js @@ -181,6 +181,10 @@ var attrs = module.exports = overrideAll({ description: 'Variables `sourceLinks` and `targetLinks` are arrays of link objects.', keys: ['value', 'label'] }), + moreInfo: { + valType: 'data_array', + dflt: [], + }, description: 'The nodes of the Sankey plot.' }, @@ -255,6 +259,10 @@ var attrs = module.exports = overrideAll({ description: 'Variables `source` and `target` are node objects.', keys: ['value', 'label'] }), + moreInfo: { + valType: 'data_array', + dflt: [], + }, colorscales: templatedArray('concentrationscales', { editType: 'calc', label: { diff --git a/src/traces/sankey/defaults.js b/src/traces/sankey/defaults.js index a82706c3cb4..647dbce1f1f 100644 --- a/src/traces/sankey/defaults.js +++ b/src/traces/sankey/defaults.js @@ -42,6 +42,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerceNode('hoverinfo', traceIn.hoverinfo); handleHoverLabelDefaults(nodeIn, nodeOut, coerceNode, hoverlabelDefault); coerceNode('hovertemplate'); + coerceNode('moreInfo'); var colors = layout.colorway; @@ -67,6 +68,7 @@ module.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout coerceLink('hoverinfo', traceIn.hoverinfo); handleHoverLabelDefaults(linkIn, linkOut, coerceLink, hoverlabelDefault); coerceLink('hovertemplate'); + coerceLink('moreInfo'); var defaultLinkColor = tinycolor(layout.paper_bgcolor).getLuminance() < 0.333 ? 'rgba(255, 255, 255, 0.6)' : diff --git a/src/traces/sankey/render.js b/src/traces/sankey/render.js index ac2fdfcf30d..7310a13eaa5 100644 --- a/src/traces/sankey/render.js +++ b/src/traces/sankey/render.js @@ -296,6 +296,7 @@ function linkModel(d, l, i) { // for event data l.trace = d.trace; l.curveNumber = d.trace.index; + l.moreInfo = d.trace.link.moreInfo[i]; return { circular: d.circular, @@ -483,6 +484,7 @@ function nodeModel(d, n) { // for event data n.trace = d.trace; n.curveNumber = d.trace.index; + n.moreInfo = d.trace.node.moreInfo[n.pointNumber]; return { index: n.pointNumber, From cb7326751ddb1c95bc0c2d5be82e2c4d6c0fca38 Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 13:28:27 +0200 Subject: [PATCH 4/7] [TASK] updated version number --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 50d614bf1f0..b8908de37e7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plotly.js", - "version": "1.49.4", + "version": "1.49.5", "description": "The open source javascript graphing library that powers plotly", "license": "MIT", "main": "./lib/index.js", From 700dcd98a4c875de568f162dd63efd29edcc84bb Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 14:00:06 +0200 Subject: [PATCH 5/7] [TASK] read img tag from label and create image svg --- dist/plotly.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++- package.json | 2 +- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/dist/plotly.js b/dist/plotly.js index d0ca20e951c..5c4de67e221 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -181615,6 +181615,45 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .attr('d', textGuidePath) .attr('transform', sankeyInverseTransform); + + + var nodeLabelImage = nodeCentered.selectAll('.' + 'node-label-image') + .data(repeat); + + nodeLabelImage.enter() + .append('image') + .classed('node-label-image', true) + .attr('xlink:href', function(d) { + var label = d.node.label; + + var IMG_REGEX = /(.*)()(.*)/i; + var foundUrl = ''; + + label.replace(IMG_REGEX, + function(match, textA, prefix, url, suffix, textB) { + foundUrl = url; + return url; + } + ); + + return foundUrl; + }) + .attr('style', 'transform: translateY(-9px) translateX(0px)') + // .attr('width', function(d) { + // var label = d.node.label; + // var IMG_WIDTH_REGEX = /()/i; + // var width = ''; + // label.replace(IMG_WIDTH_REGEX, function(match, imgTag, numberValue) { + // width = numberValue; + // return numberValue; + // }); + // debugger; + // return width; + // }) + .attr('width', '16') + .attr('height', '16'); + + var nodeLabel = nodeCentered.selectAll('.' + c.cn.nodeLabel) .data(repeat); @@ -181649,7 +181688,17 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .style('fill', nodeTextColor); nodeLabelTextPath - .text(function(d) {return d.horizontal || d.node.dy > 5 ? d.node.label : '';}) + .text(function(d) { + var label = d.node.label; + var IMG_REGEX = /(.*)()(.*)/i; + var imgTag = ''; + label = label.replace(IMG_REGEX, + function(match, textA, prefix, url, suffix, textB) { + return textA + textB; + } + ); + return d.horizontal || d.node.dy > 5 ? label : ''; + }) .attr('text-anchor', function(d) {return d.horizontal && d.left ? 'end' : 'start';}); nodeLabelTextPath diff --git a/package.json b/package.json index b8908de37e7..7bf500a0373 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "plotly.js", - "version": "1.49.5", + "version": "1.49.6", "description": "The open source javascript graphing library that powers plotly", "license": "MIT", "main": "./lib/index.js", From 97cef8c29791ecb68f7eb9e0cfb03d155093aca7 Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Thu, 29 Aug 2019 14:26:26 +0200 Subject: [PATCH 6/7] [TASK] adjust render.js to contain changes also implemented in plotly.js --- src/traces/sankey/render.js | 48 ++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/src/traces/sankey/render.js b/src/traces/sankey/render.js index 7310a13eaa5..0a0e577d3ff 100644 --- a/src/traces/sankey/render.js +++ b/src/traces/sankey/render.js @@ -1021,6 +1021,42 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .attr('d', textGuidePath) .attr('transform', sankeyInverseTransform); + var nodeLabelImage = nodeCentered.selectAll('.' + 'node-label-image') + .data(repeat); + + nodeLabelImage.enter() + .append('image') + .classed('node-label-image', true) + .attr('xlink:href', function(d) { + var label = d.node.label; + + var IMG_REGEX = /(.*)()(.*)/i; + var foundUrl = ''; + + label.replace(IMG_REGEX, + function(match, textA, prefix, url, suffix, textB) { + foundUrl = url; + return url; + } + ); + + return foundUrl; + }) + .attr('style', 'transform: translateY(-9px) translateX(0px)') + // .attr('width', function(d) { + // var label = d.node.label; + // var IMG_WIDTH_REGEX = /()/i; + // var width = ''; + // label.replace(IMG_WIDTH_REGEX, function(match, imgTag, numberValue) { + // width = numberValue; + // return numberValue; + // }); + // debugger; + // return width; + // }) + .attr('width', '16') + .attr('height', '16'); + var nodeLabel = nodeCentered.selectAll('.' + c.cn.nodeLabel) .data(repeat); @@ -1055,7 +1091,17 @@ module.exports = function(gd, svg, calcData, layout, callbacks) { .style('fill', nodeTextColor); nodeLabelTextPath - .text(function(d) {return d.horizontal || d.node.dy > 5 ? d.node.label : '';}) + .text(function(d) { + var label = d.node.label; + var IMG_REGEX = /(.*)()(.*)/i; + var imgTag = ''; + label = label.replace(IMG_REGEX, + function(match, textA, prefix, url, suffix, textB) { + return textA + textB; + } + ); + return d.horizontal || d.node.dy > 5 ? label : ''; + }) .attr('text-anchor', function(d) {return d.horizontal && d.left ? 'end' : 'start';}); nodeLabelTextPath From b78d287b637b9289973275468bb16eb103f60ec7 Mon Sep 17 00:00:00 2001 From: Sebastian Wojtowicz Date: Wed, 6 Jan 2021 20:34:49 +0100 Subject: [PATCH 7/7] [TASK] add possibility to fetch zoom event and prevent further execution --- dist/plotly.js | 5158 ++++++++++++++++++++++++------------------------ 1 file changed, 2587 insertions(+), 2571 deletions(-) diff --git a/dist/plotly.js b/dist/plotly.js index 28b504e639c..1c94a6b86f8 100644 --- a/dist/plotly.js +++ b/dist/plotly.js @@ -915,7 +915,7 @@ proto.setMode = function(mode) { prev.recalcMatrix(lastT) next.setMatrix(lastT, prev.computedMatrix) - + this._active = next this._mode = mode @@ -5153,7 +5153,7 @@ module.exports = function newArray(start, end) { var len = end-start if (len<0) throw new Error('array length must be positive') - + var a = new Array(len) for (var i=0, c=start; i=p0)&&!(p1>=hi)', + '!(lo>=p0)&&!(p1>=hi)', ['p0', 'p1']) var partitionStartEqual = genPartition( @@ -11017,10 +11017,10 @@ function iterInit(d, count) { //Append item to queue function iterPush(ptr, - axis, - redStart, redEnd, - blueStart, blueEnd, - state, + axis, + redStart, redEnd, + blueStart, blueEnd, + state, lo, hi) { var iptr = IFRAME_SIZE * ptr @@ -11132,14 +11132,14 @@ function boxIntersectIter( 0, 0, xSize, 0, ySize, - initFull ? 16 : 0, + initFull ? 16 : 0, -Infinity, Infinity) if(!initFull) { iterPush(top++, 0, 0, ySize, 0, xSize, - 1, + 1, -Infinity, Infinity) } @@ -11192,14 +11192,14 @@ function boxIntersectIter( continue } } - + var redCount = redEnd - redStart var blueCount = blueEnd - blueStart if(full) { if(d * redCount * (redCount + blueCount) < SCAN_COMPLETE_CUTOFF) { retval = sweep.scanComplete( - d, axis, visit, + d, axis, visit, redStart, redEnd, red, redIndex, blueStart, blueEnd, blue, blueIndex) if(retval !== void 0) { @@ -11221,7 +11221,7 @@ function boxIntersectIter( } else if(d * redCount * blueCount < SCAN_CUTOFF) { //If input medium sized, then use sweep and prune retval = sweep.scanBipartite( - d, axis, visit, flip, + d, axis, visit, flip, redStart, redEnd, red, redIndex, blueStart, blueEnd, blue, blueIndex) if(retval !== void 0) { @@ -11230,10 +11230,10 @@ function boxIntersectIter( continue } } - + //First, find all red intervals whose interior contains (lo,hi) var red0 = partitionInteriorContainsInterval( - d, axis, + d, axis, redStart, redEnd, red, redIndex, lo, hi) @@ -11290,7 +11290,7 @@ function boxIntersectIter( // Points > mid point // var blue0 = findMedian( - d, axis, + d, axis, blueStart, blueEnd, blue, blueIndex) var mid = blue[elemSize * blue0 + axis] var blue1 = partitionStartEqual( @@ -11459,8 +11459,8 @@ function insertionSort(d, axis, start, end, boxes, ids) { var boxPtr = elemSize * (start+1) + axis for(var i=start+1; istart && boxes[ptr+axis] > x; + for(var j=i, ptr=elemSize*(i-1); + j>start && boxes[ptr+axis] > x; --j, ptr-=elemSize) { //Swap var aPtr = ptr @@ -11490,14 +11490,14 @@ function findMedian(d, axis, start, end, boxes, ids) { var elemSize = 2*d var pivot = mid var value = boxes[elemSize*mid+axis] - + while(lo < hi) { if(hi - lo < PARTITION_THRESHOLD) { insertionSort(d, axis, lo, hi, boxes, ids) value = boxes[elemSize*mid+axis] break } - + //Select pivot using median-of-3 var count = hi - lo var pivot0 = (Math.random()*count+lo)|0 @@ -11544,7 +11544,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Partition using pivot pivot = partitionStartLessThan( - d, axis, + d, axis, lo, hi-1, boxes, ids, value) @@ -11563,7 +11563,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Swap pivot to last pivot if(mid < pivot) { hi = pivot-1 - while(lo < hi && + while(lo < hi && boxes[elemSize*(hi-1)+axis] === value) { hi -= 1 } @@ -11581,7 +11581,7 @@ function findMedian(d, axis, start, end, boxes, ids) { //Make sure pivot is at start return partitionStartLessThan( - d, axis, + d, axis, start, mid, boxes, ids, boxes[elemSize*mid+axis]) } @@ -11714,19 +11714,19 @@ function comparePivot(i, y, b, data) { } function quickSort(left, right, data) { - var sixth = (right - left + 1) / 6 | 0, - index1 = left + sixth, - index5 = right - sixth, - index3 = left + right >> 1, - index2 = index3 - sixth, - index4 = index3 + sixth, - el1 = index1, - el2 = index2, - el3 = index3, - el4 = index4, - el5 = index5, - less = left + 1, - great = right - 1, + var sixth = (right - left + 1) / 6 | 0, + index1 = left + sixth, + index5 = right - sixth, + index3 = left + right >> 1, + index2 = index3 - sixth, + index4 = index3 + sixth, + el1 = index1, + el2 = index2, + el3 = index3, + el4 = index4, + el5 = index5, + less = left + 1, + great = right - 1, tmp = 0 if(compare(el1, el2, data)) { tmp = el1 @@ -11958,7 +11958,7 @@ function sweepBipartite( //process events from left->right var n = ptr >>> 1 isort(SWEEP_EVENTS, n) - + var redActive = 0 var blueActive = 0 for(var i=0; iright var n = ptr >>> 1 isort(SWEEP_EVENTS, n) - + var redActive = 0 var blueActive = 0 var commonActive = 0 @@ -12036,7 +12036,7 @@ function sweepComplete(d, visit, color = 2 i += 1 } - + if(e < 0) { //Create event var id = -(e>>1) - 1 @@ -12103,7 +12103,7 @@ function scanBipartite( d, axis, visit, flip, redStart, redEnd, red, redIndex, blueStart, blueEnd, blue, blueIndex) { - + var ptr = 0 var elemSize = 2*d var istart = axis @@ -12135,7 +12135,7 @@ function scanBipartite( //process events from left->right var n = ptr >>> 1 isort(SWEEP_EVENTS, n) - + var redActive = 0 for(var i=0; i= BLUE_FLAG) { isRed = !flip - idx -= BLUE_FLAG + idx -= BLUE_FLAG } else { isRed = !!flip idx -= 1 @@ -12154,7 +12154,7 @@ function scanBipartite( } else { var blueId = blueIndex[idx] var bluePtr = elemSize * idx - + var b0 = blue[bluePtr+axis+1] var b1 = blue[bluePtr+axis+1+d] @@ -12163,13 +12163,13 @@ red_loop: var oidx = RED_SWEEP_QUEUE[j] var redPtr = elemSize * oidx - if(b1 < red[redPtr+axis+1] || + if(b1 < red[redPtr+axis+1] || red[redPtr+axis+1+d] < b0) { continue } for(var k=axis+2; kright var n = ptr >>> 1 isort(SWEEP_EVENTS, n) - + var redActive = 0 for(var i=0; i proc_args.length) { throw new Error("cwise: Too many arguments in pre() block") @@ -17640,10 +17640,10 @@ function compileCwise(user_args) { //Check debug flag proc.debug = !!user_args.printCode || !!user_args.debug - + //Retrieve name proc.funcName = user_args.funcName || "cwise" - + //Read in block size proc.blockSize = user_args.blockSize || 64 @@ -17683,7 +17683,7 @@ function innerFill(order, proc, body) { } if (vars.length > 0) { code.push("var " + vars.join(",")) - } + } //Scan loop for(i=dimension-1; i>=0; --i) { // Start at largest stride and work your way inwards idx = order[i] @@ -17891,7 +17891,7 @@ function generateCWiseOp(proc, typesig) { dtypes[i] = typesig[2*i] orders[i] = typesig[2*i+1] } - + //Determine where block and loop indices start and end var blockBegin = [], blockEnd = [] // These indices are exposed as blocks var loopBegin = [], loopEnd = [] // These indices are iterated over @@ -17921,7 +17921,7 @@ function generateCWiseOp(proc, typesig) { var arglist = ["SS"] // SS is the overall shape over which we iterate var code = ["'use strict'"] var vars = [] - + for(var j=0; j 3) { code.push(processBlock(proc.pre, proc, dtypes)) @@ -18001,11 +18001,11 @@ function generateCWiseOp(proc, typesig) { if(proc.post.body.length > 3) { code.push(processBlock(proc.post, proc, dtypes)) } - + if(proc.debug) { console.log("-----Generated cwise routine for ", typesig, ":\n" + code.join("\n") + "\n----------") } - + var loopName = [(proc.funcName||"unnamed"), "_cwise_loop_", orders[0].join("s"),"m",matched,typeSummary(dtypes)].join("") var f = new Function(["function ",loopName,"(", arglist.join(","),"){", code.join("\n"),"} return ", loopName].join("")) return f() @@ -18044,7 +18044,7 @@ function createThunk(proc) { var code = ["'use strict'", "var CACHED={}"] var vars = [] var thunkName = proc.funcName + "_cwise_thunk" - + //Build thunk code.push(["return function ", thunkName, "(", proc.shimArgs.join(","), "){"].join("")) var typesig = [] @@ -18084,7 +18084,7 @@ function createThunk(proc) { vars.push(["type=[", string_typesig.join(","), "].join()"].join("")) vars.push("proc=CACHED[type]") code.push("var " + vars.join(",")) - + code.push(["if(!proc){", "CACHED[type]=proc=compile([", typesig.join(","), "])}", "return proc(", proc_args.join(","), ")}"].join("")) @@ -18092,7 +18092,7 @@ function createThunk(proc) { if(proc.debug) { console.log("-----Generated thunk:\n" + code.join("\n") + "\n----------") } - + //Compile thunk var thunk = new Function("compile", code.join("\n")) return thunk(compile.bind(undefined, proc)) @@ -26098,7 +26098,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); svg.remove(); } } - if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, + if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX, point.y = e.clientY; point = point.matrixTransform(container.getScreenCTM().inverse()); return [ point.x, point.y ]; @@ -26473,7 +26473,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); } function mousewheeled() { var dispatch = event.of(this, arguments); - if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), + if (mousewheelTimer) clearTimeout(mousewheelTimer); else d3_selection_interrupt.call(this), translate0 = location(center0 = center || d3.mouse(this)), zoomstarted(dispatch); mousewheelTimer = setTimeout(function() { mousewheelTimer = null; @@ -26842,7 +26842,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); d3.xhr = d3_xhrType(d3_identity); function d3_xhrType(response) { return function(url, mimeType, callback) { - if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, + if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType, mimeType = null; return d3_xhr(url, mimeType, response, callback); }; @@ -27683,7 +27683,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1; } function d3_time_parseZone(date, string, i) { - return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, + return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string, i + 5) : -1; } function d3_time_expandYear(d) { @@ -27876,7 +27876,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); var λ00, φ00, λ0, cosφ0, sinφ0; d3_geo_area.point = function(λ, φ) { d3_geo_area.point = nextPoint; - λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), + λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4), sinφ0 = Math.sin(φ); }; function nextPoint(λ, φ) { @@ -29705,7 +29705,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]); }; projection.rotate = function(_) { - return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), + return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(), [ _[0], _[1], _[2] - 90 ]); }; return rotate([ 0, 0, 90 ]); @@ -30559,7 +30559,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); }; quadtree.extent = function(_) { if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ]; - if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], + if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0], y2 = +_[1][1]; return quadtree; }; @@ -32284,7 +32284,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return d3_layout_treemapPad(node, x); } var type; - pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], + pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ], padConstant) : padConstant; return treemap; }; @@ -32687,7 +32687,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); }; scale.rangePoints = function(x, padding) { if (arguments.length < 2) padding = 0; - var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, + var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2, 0) : (stop - start) / (domain.length - 1 + padding); range = steps(start + step * padding / 2, step); rangeBand = 0; @@ -32699,7 +32699,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); }; scale.rangeRoundPoints = function(x, padding) { if (arguments.length < 2) padding = 0; - var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), + var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2), 0) : (stop - start) / (domain.length - 1 + padding) | 0; range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step); rangeBand = 0; @@ -33127,7 +33127,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension)); } function d3_svg_lineCardinalClosed(points, tension) { - return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), + return points.length < 3 ? d3_svg_lineLinearClosed(points) : points[0] + d3_svg_lineHermite((points.push(points[0]), points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension)); } function d3_svg_lineCardinal(points, tension) { @@ -33900,7 +33900,7 @@ Object.defineProperty(exports, '__esModule', { value: true }); var g = d3.select(this); var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy(); var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform; - var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), + var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"), d3.transition(path)); tickEnter.append("line"); tickEnter.append("text"); @@ -34534,7 +34534,7 @@ function triangulate(points, includePointAtInfinity) { if(n === 0) { return [] } - + var d = points[0].length if(d < 1) { return [] @@ -34544,7 +34544,7 @@ function triangulate(points, includePointAtInfinity) { if(d === 1) { return triangulate1D(n, points, includePointAtInfinity) } - + //Lift points, sort var lifted = new Array(n) var upper = 1.0 @@ -34562,7 +34562,7 @@ function triangulate(points, includePointAtInfinity) { upper = Math.max(l, upper) } uniq(lifted, compareLifted) - + //Double points n = lifted.length @@ -34772,7 +34772,7 @@ if(!hasTypedArrays) { buffer.writeUInt32LE(hi, 4, true) return buffer.readDoubleLE(0, true) } - module.exports.pack = toDouble + module.exports.pack = toDouble function lowUint(n) { buffer.writeDoubleLE(n, 0, true) return buffer.readUInt32LE(0, true) @@ -39555,7 +39555,7 @@ function fixDoubleBlack(stack) { } else { //console.log("case 2: black sibling, black parent", p.right.value) p.right = repaint(RED, s) - continue + continue } } else { //console.log("case 3: red sibling") @@ -39644,7 +39644,7 @@ function fixDoubleBlack(stack) { } else { //console.log("case 2: black sibling, black parent") p.left = repaint(RED, s) - continue + continue } } else { //console.log("case 3: red sibling") @@ -41508,7 +41508,7 @@ function prettyPrint(spacing, i) { xi = Math.floor(xi)|0 xf = xf|0 } - var xis = "" + xi + var xis = "" + xi if(x < 0) { xis = "-" + xis } @@ -44640,7 +44640,7 @@ function fromRotationTranslation(out, q, v) { out[13] = v[1]; out[14] = v[2]; out[15] = 1; - + return out; }; },{}],272:[function(_dereq_,module,exports){ @@ -44703,8 +44703,8 @@ function invert(out, a) { // Calculate the determinant det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06; - if (!det) { - return null; + if (!det) { + return null; } det = 1.0 / det; @@ -44836,7 +44836,7 @@ function multiply(out, a, b) { a30 = a[12], a31 = a[13], a32 = a[14], a33 = a[15]; // Cache only the current line of the second matrix - var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; + var b0 = b[0], b1 = b[1], b2 = b[2], b3 = b[3]; out[0] = b0*a00 + b1*a10 + b2*a20 + b3*a30; out[1] = b0*a01 + b1*a11 + b2*a21 + b3*a31; out[2] = b0*a02 + b1*a12 + b2*a22 + b3*a32; @@ -44956,7 +44956,7 @@ function rotate(out, a, rad, axis) { b20, b21, b22; if (Math.abs(len) < 0.000001) { return null; } - + len = 1 / len; x *= len; y *= len; @@ -45250,7 +45250,7 @@ function transpose(out, a) { out[14] = a[11]; out[15] = a[15]; } - + return out; }; },{}],285:[function(_dereq_,module,exports){ @@ -55578,17 +55578,17 @@ var dot = _dereq_('./dot') function angle(a, b) { var tempA = fromValues(a[0], a[1], a[2]) var tempB = fromValues(b[0], b[1], b[2]) - + normalize(tempA, tempA) normalize(tempB, tempB) - + var cosine = dot(tempA, tempB) if(cosine > 1.0){ return 0 } else { return Math.acos(cosine) - } + } } },{"./dot":339,"./fromValues":345,"./normalize":356}],330:[function(_dereq_,module,exports){ @@ -55811,7 +55811,7 @@ function forEach(a, stride, offset, count, fn, arg) { if(!offset) { offset = 0 } - + if(count) { l = Math.min((count * stride) + offset, a.length) } else { @@ -55819,15 +55819,15 @@ function forEach(a, stride, offset, count, fn, arg) { } for(i = offset; i < l; i += stride) { - vec[0] = a[i] - vec[1] = a[i+1] + vec[0] = a[i] + vec[1] = a[i+1] vec[2] = a[i+2] fn(vec, vec, arg) - a[i] = vec[0] - a[i+1] = vec[1] + a[i] = vec[0] + a[i+1] = vec[1] a[i+2] = vec[2] } - + return a } },{"./create":333}],345:[function(_dereq_,module,exports){ @@ -56116,15 +56116,15 @@ function rotateY(out, a, b, c){ // translate point to the origin var px = a[0] - bx var pz = a[2] - bz - + var sc = Math.sin(c) var cc = Math.cos(c) - + // perform rotation and translate to correct position out[0] = bx + pz * sc + px * cc out[1] = a[1] out[2] = bz + pz * cc - px * sc - + return out } @@ -56146,7 +56146,7 @@ function rotateZ(out, a, b, c){ //Translate point to the origin var px = a[0] - bx var py = a[1] - by - + var sc = Math.sin(c) var cc = Math.cos(c) @@ -56154,7 +56154,7 @@ function rotateZ(out, a, b, c){ out[0] = bx + px * cc - py * sc out[1] = by + px * sc + py * cc out[2] = a[2] - + return out } @@ -58108,7 +58108,7 @@ proto.addPeaks = function(point, cell) { var nv = neighbor.vertices //Test if neighbor is a peak - if(neighbor.lastVisited !== -n) { + if(neighbor.lastVisited !== -n) { //Compute orientation of p relative to each boundary peak var indexOfNeg1 = 0 for(var j=0; j<=d; ++j) { @@ -58333,7 +58333,7 @@ function incrementalConvexHull(points, randomSearch) { for(var i=d+1; i 1 && orient( - points[lower[m-2]], - points[lower[m-1]], + points[lower[m-2]], + points[lower[m-1]], p) <= 0) { m -= 1 lower.pop() @@ -59550,8 +59550,8 @@ function monotoneConvexHull2D(points) { //Insert into upper list m = upper.length while(m > 1 && orient( - points[upper[m-2]], - points[upper[m-1]], + points[upper[m-2]], + points[upper[m-1]], p) >= 0) { m -= 1 upper.pop() @@ -59996,7 +59996,7 @@ function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, or //Assemble arguments for(var i=0; i=0; --i) { - forLoopBegin(i, 0) + forLoopBegin(i, 0) } var phaseFuncArgs = [] for(var i=0; i 0) { - code.push('if(1') + code.push('if(1') for(var i=0; i= 0 || facet.indexOf(-(i+1)) >= 0) { continue @@ -60507,9 +60507,9 @@ function generateGradient(boundaryConditions) { dPickStr.join(), ')))}else{dst.set(', pickStr.join(), ',', bnd, ',0)};') } else { - code.push('if(s[', bnd, ']>1){diff(', outStr, - ',src.pick(', cPickStr.join(), ')', boundStr, - ',src.pick(', dPickStr.join(), ')', boundStr, + code.push('if(s[', bnd, ']>1){diff(', outStr, + ',src.pick(', cPickStr.join(), ')', boundStr, + ',src.pick(', dPickStr.join(), ')', boundStr, ');}else{zero(', outStr, ');};') } break @@ -60528,7 +60528,7 @@ function generateGradient(boundaryConditions) { if(facet[i] < 0) { aPickStr[bnd] = 's[' + bnd + ']-2' bPickStr[bnd] = '0' - + } else { aPickStr[bnd] = 's[' + bnd + ']-1' bPickStr[bnd] = '1' @@ -60540,9 +60540,9 @@ function generateGradient(boundaryConditions) { bPickStr.join(), ')))}else{dst.set(', pickStr.join(), ',', bnd, ',0)};') } else { - code.push('if(s[', bnd, ']>2){diff(', outStr, - ',src.pick(', aPickStr.join(), ')', boundStr, - ',src.pick(', bPickStr.join(), ')', boundStr, + code.push('if(s[', bnd, ']>2){diff(', outStr, + ',src.pick(', aPickStr.join(), ')', boundStr, + ',src.pick(', bPickStr.join(), ')', boundStr, ');}else{zero(', outStr, ');};') } break @@ -61052,7 +61052,7 @@ exports.norm2squared = compile({ post: {args:[], localVars:[], thisVars:["this_s"], body:"return this_s"}, funcName: "norm2squared" }) - + exports.norm2 = compile({ args:["array"], pre: {args:[], localVars:[], thisVars:["this_s"], body:"this_s=0"}, @@ -61060,7 +61060,7 @@ exports.norm2 = compile({ post: {args:[], localVars:[], thisVars:["this_s"], body:"return Math.sqrt(this_s)"}, funcName: "norm2" }) - + exports.norminf = compile({ args:["array"], @@ -61164,7 +61164,7 @@ exports.argmax = compile({ args:[], thisVars:["this_i"], localVars:[]} -}) +}) exports.random = makeOp({ args: ["array"], @@ -61188,9 +61188,9 @@ exports.equals = compile({ args:["array", "array"], pre: EmptyProc, body: {args:[{name:"x", lvalue:false, rvalue:true, count:1}, - {name:"y", lvalue:false, rvalue:true, count:1}], - body: "if(x!==y){return false}", - localVars: [], + {name:"y", lvalue:false, rvalue:true, count:1}], + body: "if(x!==y){return false}", + localVars: [], thisVars: []}, post: {args:[], localVars:[], thisVars:[], body:"return true"}, funcName: "equals" @@ -61280,9 +61280,9 @@ function createInsertionSort(order, dtype) { var funcName = ["ndarrayInsertionSort", order.join("d"), dtype].join("") var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) var allocator = getMallocFree(dtype) - + var vars = [ "i,j,cptr,ptr=left*s0+offset" ] - + if(order.length > 1) { var scratch_shape = [] for(var i=1; i 1) { - + //Copy data into scratch code.push("dptr=0;sptr=ptr") for(var i=order.length-1; i>=0; --i) { @@ -61341,7 +61341,7 @@ function createInsertionSort(order, dtype) { code.push("sptr+=d"+j,"}") } - + //Compare items in outer loop code.push("__g:while(j-->left){", "dptr=0", @@ -61359,7 +61359,7 @@ function createInsertionSort(order, dtype) { "dptr+=f"+i, "}") } - + //Copy data back code.push("dptr=cptr;sptr=cptr-s0") for(var i=order.length-1; i>=0; --i) { @@ -61377,7 +61377,7 @@ function createInsertionSort(order, dtype) { } code.push(["dptr+=d",j,";sptr+=d",j].join(""),"}") } - + //Close while loop code.push("cptr-=s0\n}") @@ -61406,14 +61406,14 @@ function createInsertionSort(order, dtype) { "}", dataWrite("cptr", "scratch")) } - + //Close outer loop body code.push("}") if(order.length > 1 && allocator) { code.push("free(scratch)") } code.push("} return " + funcName) - + //Compile and link function if(allocator) { var result = new Function("malloc", "free", code.join("\n")) @@ -61430,9 +61430,9 @@ function createQuickSort(order, dtype, insertionSort) { var funcArgs = ["left", "right", "data", "offset" ].concat(shapeArgs(order.length)) var allocator = getMallocFree(dtype) var labelCounter=0 - + code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - + var vars = [ "sixth=((right-left+1)/6)|0", "index1=left+sixth", @@ -61461,7 +61461,7 @@ function createQuickSort(order, dtype, insertionSort) { "comp_pivot2=0", "comp=0" ] - + if(order.length > 1) { var ele_size = [] for(var i=1; i 1 && allocator) { code.push("free(pivot1)", "free(pivot2)") } } - + function compareSwap(a_id, b_id) { var a = "el"+a_id var b = "el"+b_id @@ -61610,7 +61610,7 @@ function createQuickSort(order, dtype, insertionSort) { code.push(["if(", dataRead(toPointer(a)), ">", dataRead(toPointer(b)), "){tmp0=", a, ";",a,"=",b,";", b,"=tmp0}"].join("")) } } - + compareSwap(1, 2) compareSwap(4, 5) compareSwap(1, 3) @@ -61620,7 +61620,7 @@ function createQuickSort(order, dtype, insertionSort) { compareSwap(2, 5) compareSwap(2, 3) compareSwap(4, 5) - + if(order.length > 1) { cacheLoop(["el1", "el2", "el3", "el4", "el5", "index1", "index3", "index5"], true, [ "pivot1[pivot_ptr]=",dataRead("ptr1"),"\n", @@ -61646,7 +61646,7 @@ function createQuickSort(order, dtype, insertionSort) { dataWrite(toPointer("index5"), "z") ].join("")) } - + function moveElement(dst, src) { if(order.length > 1) { @@ -61657,10 +61657,10 @@ function createQuickSort(order, dtype, insertionSort) { code.push(dataWrite(toPointer(dst), dataRead(toPointer(src)))) } } - + moveElement("index2", "left") moveElement("index4", "right") - + function comparePivot(result, ptr, n) { if(order.length > 1) { var lbl = "__l" + (++labelCounter) @@ -61672,7 +61672,7 @@ function createQuickSort(order, dtype, insertionSort) { code.push([result,"=", dataRead(toPointer(ptr)), "-pivot", n].join("")) } } - + function swapElements(a, b) { if(order.length > 1) { cacheLoop([a,b],false,[ @@ -61690,7 +61690,7 @@ function createQuickSort(order, dtype, insertionSort) { ].join("")) } } - + function tripleSwap(k, less, great) { if(order.length > 1) { cacheLoop([k,less,great], false, [ @@ -61714,12 +61714,12 @@ function createQuickSort(order, dtype, insertionSort) { ].join("")) } } - + function swapAndDecrement(k, great) { swapElements(k, great) code.push("--"+great) } - + code.push("if(pivots_are_equal){") //Pivots are equal case code.push("for(k=less;k<=great;++k){") @@ -61776,7 +61776,7 @@ function createQuickSort(order, dtype, insertionSort) { code.push("}") code.push("}") code.push("}") - + //Move pivots to correct place function storePivot(mem_dest, pivot_dest, pivot) { if(order.length>1) { @@ -61790,7 +61790,7 @@ function createQuickSort(order, dtype, insertionSort) { dataWrite(toPointer(pivot_dest), "pivot"+pivot)) } } - + storePivot("left", "(less-1)", 1) storePivot("right", "(great+1)", 2) @@ -61806,13 +61806,13 @@ function createQuickSort(order, dtype, insertionSort) { } doSort("left", "(less-2)") doSort("(great+2)", "right") - + //If pivots are equal, then early out code.push("if(pivots_are_equal){") cleanUp() code.push("return") code.push("}") - + function walkPointer(ptr, pivot, body) { if(order.length > 1) { code.push(["__l",++labelCounter,":while(true){"].join("")) @@ -61824,13 +61824,13 @@ function createQuickSort(order, dtype, insertionSort) { code.push(["while(", dataRead(toPointer(ptr)), "===pivot", pivot, "){", body, "}"].join("")) } } - + //Check bounds code.push("if(lessindex5){") - + walkPointer("less", 1, "++less") walkPointer("great", 2, "--great") - + code.push("for(k=less;k<=great;++k){") comparePivot("comp_pivot1", "k", 1) code.push("if(comp_pivot1===0){") @@ -61860,14 +61860,14 @@ function createQuickSort(order, dtype, insertionSort) { code.push("}") code.push("}") code.push("}") - + //Clean up and do a final sorting pass cleanUp() doSort("less", "great") - + //Close off main loop code.push("}return " + funcName) - + //Compile and link if(order.length > 1 && allocator) { var compiled = new Function("insertionSort", "malloc", "free", code.join("\n")) @@ -61881,15 +61881,15 @@ function compileSort(order, dtype) { var code = ["'use strict'"] var funcName = ["ndarraySortWrapper", order.join("d"), dtype].join("") var funcArgs = [ "array" ] - + code.push(["function ", funcName, "(", funcArgs.join(","), "){"].join("")) - + //Unpack local variables from array var vars = ["data=array.data,offset=array.offset|0,shape=array.shape,stride=array.stride"] for(var i=0; i 1e-6) { @@ -63046,7 +63046,7 @@ proto.rotate = function(t, dx, dy, dz) { var cy = ay*bw + aw*by + az*bx - ax*bz var cz = az*bw + aw*bz + ax*by - ay*bx var cw = aw*bw - ax*bx - ay*by - az*bz - + //Apply roll if(dz) { bx = fx @@ -63129,7 +63129,7 @@ proto.setMatrix = function(t, matrix) { var cy = mat[13]/w var cz = mat[14]/w - this.recalcMatrix(t) + this.recalcMatrix(t) var r = Math.exp(this.computedRadius[0]) this.center.set(t, cx-mat[2]*r, cy-mat[6]*r, cz-mat[10]*r) this.radius.idle(t) @@ -63149,7 +63149,7 @@ proto.setDistanceLimits = function(lo, hi) { if(lo > 0) { lo = Math.log(lo) } else { - lo = -Infinity + lo = -Infinity } if(hi > 0) { hi = Math.log(hi) @@ -63845,8 +63845,8 @@ function planarDual(cells, positions) { var e = nbhd[k] var p = e[dir^1] var cmp = compareAngle( - positions[a], - positions[b], + positions[a], + positions[b], positions[nextVertex], positions[p]) if(cmp > 0) { @@ -63974,7 +63974,7 @@ function trimLeaves(edges, positions) { nedges.push([ newIndex[e[0]], newIndex[e[1]] ]) } } - + return [ nedges, npositions ] } },{"edges-to-adjacency-list":173}],466:[function(_dereq_,module,exports){ @@ -66417,7 +66417,7 @@ function closestPoint2d(V0, V1, V2, point, result) { } } else { var tmp0, tmp1, numer, denom; - + if (s < 0) { // region 2 tmp0 = a01 + b0; tmp1 = a11 + b1; @@ -69842,7 +69842,7 @@ function determinant(m) { function compileDeterminant(n) { var proc = new Function("sum", "scale", "prod", "compress", [ - "function robustDeterminant",n, "(m){return compress(", + "function robustDeterminant",n, "(m){return compress(", determinant(matrix(n)), ")};return robustDeterminant", n].join("")) return proc(robustSum, robustScale, twoProduct, compress) @@ -69987,7 +69987,7 @@ function orientation(n) { for(var i=0; i>1; i>=0; --i) { heapDown(i) } - + //Kill vertices while(true) { var hmin = heapPop() @@ -72450,7 +72450,7 @@ function stronglyConnectedComponents(adjList) { var child = new Array(numVertices) var scc = new Array(numVertices) var sccLinks = new Array(numVertices) - + //Initialize tables for(var i=0; i 3) { ushift = 1 } @@ -75463,7 +75463,7 @@ proto.setMatrix = function(t, mat, axes, noSnap) { var fshift = (ushift + 1) % 3 //Recompute state for new t value - if(!mat) { + if(!mat) { this.recalcMatrix(t) mat = this.computedMatrix } @@ -75505,7 +75505,7 @@ proto.setMatrix = function(t, mat, axes, noSnap) { rx /= rl ry /= rl rz /= rl - + var fx = uy * rz - uz * ry var fy = uz * rx - ux * rz var fz = ux * ry - uy * rx @@ -76061,9 +76061,9 @@ exports.freeInt32 = exports.freeBigInt64 = exports.freeFloat32 = exports.freeFloat = -exports.freeFloat64 = -exports.freeDouble = -exports.freeUint8Clamped = +exports.freeFloat64 = +exports.freeDouble = +exports.freeUint8Clamped = exports.freeDataView = freeTypedArray exports.freeArrayBuffer = freeArrayBuffer @@ -76235,7 +76235,7 @@ module.exports = UnionFind; function UnionFind(count) { this.roots = new Array(count); this.ranks = new Array(count); - + for(var i=0; i 12) { throw main.local.invalidMonth @@ -77959,7 +77959,7 @@ assign(ChineseCalendar.prototype, { var y = (packedDate >> 9) & 0xFFF; var m = (packedDate >> 5) & 0x0F; var d = packedDate & 0x1F; - + // find first Thrusday of the year var firstThursday; firstThursday = gregorianCalendar.newDate(y, m, d); @@ -78167,7 +78167,7 @@ var LUNAR_MONTH_DAYS = [1887, 0x1694, 0x16aa, 0x4ad5, 0x136a5, 0xda4, 0x15ac]; // Table of Chinese New Years from year 1888 to 2111 -// +// // bits (0 to 4): solar day // bits (5 to 8): solar month // bits (9 to 20): solar year @@ -78392,7 +78392,7 @@ function toSolar(yearOrDate, monthOrResult, day, isIntercalaryOrResult, result) /* http://keith-wood.name/calendars.html Coptic calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) February 2010. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -78576,7 +78576,7 @@ main.calendars.coptic = CopticCalendar; /* http://keith-wood.name/calendars.html Discworld calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2016. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -78804,7 +78804,7 @@ main.calendars.discworld = DiscworldCalendar; /* http://keith-wood.name/calendars.html Ethiopian calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) February 2010. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -78988,7 +78988,7 @@ main.calendars.ethiopian = EthiopianCalendar; /* http://keith-wood.name/calendars.html Hebrew calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -79262,7 +79262,7 @@ main.calendars.hebrew = HebrewCalendar; /* http://keith-wood.name/calendars.html Islamic calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -79443,7 +79443,7 @@ main.calendars.islamic = IslamicCalendar; /* http://keith-wood.name/calendars.html Julian calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -79626,7 +79626,7 @@ main.calendars.julian = JulianCalendar; /* http://keith-wood.name/calendars.html Mayan calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -79921,7 +79921,7 @@ main.calendars.mayan = MayanCalendar; /* http://keith-wood.name/calendars.html Nanakshahi calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) January 2016. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -80101,7 +80101,7 @@ main.calendars.nanakshahi = NanakshahiCalendar; /* http://keith-wood.name/calendars.html Nepali calendar for jQuery v2.0.2. Written by Artur Neumann (ict.projects{at}nepal.inf.org) April 2013. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -80109,7 +80109,7 @@ var assign = _dereq_('object-assign'); /** Implementation of the Nepali civil calendar. - Based on the ideas from + Based on the ideas from http://codeissue.com/articles/a04e050dea7468f/algorithm-to-convert-english-date-to-nepali-date-using-c-net and http://birenj2ee.blogspot.com/2011/04/nepali-calendar-in-java.html See also http://en.wikipedia.org/wiki/Nepali_calendar @@ -80143,7 +80143,7 @@ assign(NepaliCalendar.prototype, { firstMonth: 1, /** The minimum day number. @memberof NepaliCalendar */ - minDay: 1, + minDay: 1, /** The number of days in the year. @memberof NepaliCalendar */ daysPerYear: 365, @@ -80271,21 +80271,21 @@ assign(NepaliCalendar.prototype, { var gregorianYear = nepaliYear - (nepaliMonthToCheck > 9 || (nepaliMonthToCheck === 9 && nepaliDay >= this.NEPALI_CALENDAR_DATA[nepaliYearToCheck][0]) ? 56 : 57); // First we add the amount of days in the actual Nepali month as the day of year in the - // Gregorian one because at least this days are gone since the 1st. Jan. + // Gregorian one because at least this days are gone since the 1st. Jan. if (nepaliMonth !== 9) { gregorianDayOfYear = nepaliDay; nepaliMonthToCheck--; } - // Now we loop throw all Nepali month and add the amount of days to gregorianDayOfYear - // we do this till we reach Paush (9th month). 1st. January always falls in this month + // Now we loop throw all Nepali month and add the amount of days to gregorianDayOfYear + // we do this till we reach Paush (9th month). 1st. January always falls in this month while (nepaliMonthToCheck !== 9) { if (nepaliMonthToCheck <= 0) { nepaliMonthToCheck = 12; nepaliYearToCheck--; - } + } gregorianDayOfYear += this.NEPALI_CALENDAR_DATA[nepaliYearToCheck][nepaliMonthToCheck]; nepaliMonthToCheck--; - } + } // If the date that has to be converted is in Paush (month no. 9) we have to do some other calculation if (nepaliMonth === 9) { // Add the days that are passed since the first day of Paush and substract the @@ -80301,10 +80301,10 @@ assign(NepaliCalendar.prototype, { else { gregorianDayOfYear += this.NEPALI_CALENDAR_DATA[nepaliYearToCheck][9] - this.NEPALI_CALENDAR_DATA[nepaliYearToCheck][0]; - } + } return gregorianCalendar.newDate(gregorianYear, 1 ,1).add(gregorianDayOfYear, 'd').toJD(); }, - + /** Create a new date from a Julian date. @memberof NepaliCalendar @param jd {number} The Julian date to convert. @@ -80317,29 +80317,29 @@ assign(NepaliCalendar.prototype, { var nepaliYear = gregorianYear + 56; //this is not final, it could be also +57 but +56 is always true for 1st Jan. this._createMissingCalendarData(nepaliYear); var nepaliMonth = 9; // Jan 1 always fall in Nepali month Paush which is the 9th month of Nepali calendar. - // Get the Nepali day in Paush (month 9) of 1st January + // Get the Nepali day in Paush (month 9) of 1st January var dayOfFirstJanInPaush = this.NEPALI_CALENDAR_DATA[nepaliYear][0]; // Check how many days are left of Paush . - // Days calculated from 1st Jan till the end of the actual Nepali month, + // Days calculated from 1st Jan till the end of the actual Nepali month, // we use this value to check if the gregorian Date is in the actual Nepali month. var daysSinceJanFirstToEndOfNepaliMonth = this.NEPALI_CALENDAR_DATA[nepaliYear][nepaliMonth] - dayOfFirstJanInPaush + 1; - // If the gregorian day-of-year is smaller o equal than the sum of days between the 1st January and + // If the gregorian day-of-year is smaller o equal than the sum of days between the 1st January and // the end of the actual nepali month we found the correct nepali month. - // Example: + // Example: // The 4th February 2011 is the gregorianDayOfYear 35 (31 days of January + 4) // 1st January 2011 is in the nepali year 2067, where 1st. January is in the 17th day of Paush (9th month) - // In 2067 Paush has 30days, This means (30-17+1=14) there are 14days between 1st January and end of Paush + // In 2067 Paush has 30days, This means (30-17+1=14) there are 14days between 1st January and end of Paush // (including 17th January) // The gregorianDayOfYear (35) is bigger than 14, so we check the next month - // The next nepali month (Mangh) has 29 days + // The next nepali month (Mangh) has 29 days // 29+14=43, this is bigger than gregorianDayOfYear(35) so, we found the correct nepali month while (gregorianDayOfYear > daysSinceJanFirstToEndOfNepaliMonth) { nepaliMonth++; if (nepaliMonth > 12) { nepaliMonth = 1; nepaliYear++; - } + } daysSinceJanFirstToEndOfNepaliMonth += this.NEPALI_CALENDAR_DATA[nepaliYear][nepaliMonth]; } // The last step is to calculate the nepali day-of-month @@ -80347,12 +80347,12 @@ assign(NepaliCalendar.prototype, { // we calculated there are 43 days from 1st. January (17 Paush) till end of Mangh (29 days) // when we subtract from this 43 days the day-of-year of the the Gregorian date (35), // we know how far the searched day is away from the end of the Nepali month. - // So we simply subtract this number from the amount of days in this month (30) + // So we simply subtract this number from the amount of days in this month (30) var nepaliDayOfMonth = this.NEPALI_CALENDAR_DATA[nepaliYear][nepaliMonth] - - (daysSinceJanFirstToEndOfNepaliMonth - gregorianDayOfYear); + (daysSinceJanFirstToEndOfNepaliMonth - gregorianDayOfYear); return this.newDate(nepaliYear, nepaliMonth, nepaliDayOfMonth); }, - + /** Creates missing data in the NEPALI_CALENDAR_DATA table. This data will not be correct but just give an estimated result. Mostly -/+ 1 day @private @@ -80366,7 +80366,7 @@ assign(NepaliCalendar.prototype, { } } }, - + NEPALI_CALENDAR_DATA: { // These data are from http://www.ashesh.com.np 1970: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], @@ -80390,7 +80390,7 @@ assign(NepaliCalendar.prototype, { 1988: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 29, 30, 31], 1989: [18, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], 1990: [18, 31, 31, 32, 31, 31, 31, 30, 29, 30, 29, 30, 30], - 1991: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], + 1991: [18, 31, 32, 31, 32, 31, 30, 30, 29, 30, 29, 30, 30], // These data are from http://nepalicalendar.rat32.com/index.php 1992: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 29, 31], 1993: [18, 31, 31, 31, 32, 31, 31, 30, 29, 30, 29, 30, 30], @@ -80501,9 +80501,9 @@ assign(NepaliCalendar.prototype, { 2097: [17, 31, 32, 31, 32, 31, 30, 30, 30, 29, 30, 30, 30], 2098: [17, 31, 31, 32, 31, 31, 31, 29, 30, 29, 30, 30, 31], 2099: [17, 31, 31, 32, 31, 31, 31, 30, 29, 29, 30, 30, 30], - 2100: [17, 31, 32, 31, 32, 30, 31, 30, 29, 30, 29, 30, 30] + 2100: [17, 31, 32, 31, 32, 30, 31, 30, 29, 30, 29, 30, 30] } -}); +}); // Nepali calendar implementation main.calendars.nepali = NepaliCalendar; @@ -80524,7 +80524,7 @@ main.calendars.nepali = NepaliCalendar; /* http://keith-wood.name/calendars.html Persian calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -80714,7 +80714,7 @@ main.calendars.jalali = PersianCalendar; /* http://keith-wood.name/calendars.html Taiwanese (Minguo) calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) February 2010. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -80900,7 +80900,7 @@ main.calendars.taiwan = TaiwanCalendar; /* http://keith-wood.name/calendars.html Thai calendar for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) February 2010. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -80928,7 +80928,7 @@ assign(ThaiCalendar.prototype, { jdEpoch: 1523098.5, /** Difference in years between Thai and Gregorian calendars. @memberof ThaiCalendar */ - yearsOffset: 543, + yearsOffset: 543, /** Days per month in a common year. @memberof ThaiCalendar */ daysPerMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], @@ -81087,7 +81087,7 @@ main.calendars.thai = ThaiCalendar; UmmAlQura calendar for jQuery v2.0.2. Written by Amro Osama March 2013. Modified by Binnooh.com & www.elm.sa - 2014 - Added dates back to 1276 Hijri year. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var main = _dereq_('../main'); @@ -81245,7 +81245,7 @@ assign(UmmAlQuraCalendar.prototype, { @return {CDate} The equivalent date. */ fromJD: function (jd) { var mcjdn = jd - 2400000 + 0.5; // Modified Chronological Julian Day Number (MCJDN) - // the MCJDN's of the start of the lunations in the Umm al-Qura calendar + // the MCJDN's of the start of the lunations in the Umm al-Qura calendar // are stored in the 'ummalqura_dat' array var index = 0; for (var i = 0; i < ummalqura_dat.length; i++) { @@ -81296,7 +81296,7 @@ assign(UmmAlQuraCalendar.prototype, { main.calendars.ummalqura = UmmAlQuraCalendar; var ummalqura_dat = [ - 20, 50, 79, 109, 138, 168, 197, 227, 256, 286, 315, 345, 374, 404, 433, 463, 492, 522, 551, 581, + 20, 50, 79, 109, 138, 168, 197, 227, 256, 286, 315, 345, 374, 404, 433, 463, 492, 522, 551, 581, 611, 641, 670, 700, 729, 759, 788, 818, 847, 877, 906, 936, 965, 995, 1024, 1054, 1083, 1113, 1142, 1172, 1201, 1231, 1260, 1290, 1320, 1350, 1379, 1409, 1438, 1468, 1497, 1527, 1556, 1586, 1615, 1645, 1674, 1704, 1733, 1763, 1792, 1822, 1851, 1881, 1910, 1940, 1969, 1999, 2028, 2058, 2087, 2117, 2146, 2176, 2205, 2235, 2264, 2294, 2323, 2353, @@ -81451,7 +81451,7 @@ var ummalqura_dat = [ /* http://keith-wood.name/calendars.html Calendars for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var assign = _dereq_('object-assign'); @@ -81512,7 +81512,7 @@ assign(Calendars.prototype, { this.instance(calendar, language) : calendar)) || this.instance(); return calendar.newDate(year, month, day); }, - + /** A simple digit substitution function for localising numbers via the Calendar digits option. @member Calendars @param digits {string[]} The substitute digits, for 0 through 9. @@ -81524,7 +81524,7 @@ assign(Calendars.prototype, { }); } }, - + /** Digit substitution function for localising Chinese style numbers via the Calendar digits option. @member Calendars @param digits {string[]} The substitute digits, for 0 through 9. @@ -82200,7 +82200,7 @@ assign(GregorianCalendar.prototype, { isRTL: false } }, - + /** Determine whether this date is in a leap year. @memberof GregorianCalendar @param year {CDate|number} The date to examine or the year to examine. @@ -82356,7 +82356,7 @@ _exports.calendars.gregorian = GregorianCalendar; /* http://keith-wood.name/calendars.html Calendars extras for jQuery v2.0.2. Written by Keith Wood (wood.keith{at}optusnet.com.au) August 2009. - Available under the MIT (http://keith-wood.name/licence.html) license. + Available under the MIT (http://keith-wood.name/licence.html) license. Please attribute the author if you use it. */ var assign = _dereq_('object-assign'); @@ -82999,192 +82999,192 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; module.exports = templatedArray('annotation', { visible: { valType: 'boolean', - + dflt: true, editType: 'calc+arraydraw', - + }, text: { valType: 'string', - + editType: 'calc+arraydraw', - + }, textangle: { valType: 'angle', dflt: 0, - + editType: 'calc+arraydraw', - + }, font: fontAttrs({ editType: 'calc+arraydraw', colorEditType: 'arraydraw', - + }), width: { valType: 'number', min: 1, dflt: null, - + editType: 'calc+arraydraw', - + }, height: { valType: 'number', min: 1, dflt: null, - + editType: 'calc+arraydraw', - + }, opacity: { valType: 'number', min: 0, max: 1, dflt: 1, - + editType: 'arraydraw', - + }, align: { valType: 'enumerated', values: ['left', 'center', 'right'], dflt: 'center', - + editType: 'arraydraw', - + }, valign: { valType: 'enumerated', values: ['top', 'middle', 'bottom'], dflt: 'middle', - + editType: 'arraydraw', - + }, bgcolor: { valType: 'color', dflt: 'rgba(0,0,0,0)', - + editType: 'arraydraw', - + }, bordercolor: { valType: 'color', dflt: 'rgba(0,0,0,0)', - + editType: 'arraydraw', - + }, borderpad: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc+arraydraw', - + }, borderwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc+arraydraw', - + }, // arrow showarrow: { valType: 'boolean', dflt: true, - + editType: 'calc+arraydraw', - + }, arrowcolor: { valType: 'color', - + editType: 'arraydraw', - + }, arrowhead: { valType: 'integer', min: 0, max: ARROWPATHS.length, dflt: 1, - + editType: 'arraydraw', - + }, startarrowhead: { valType: 'integer', min: 0, max: ARROWPATHS.length, dflt: 1, - + editType: 'arraydraw', - + }, arrowside: { valType: 'flaglist', flags: ['end', 'start'], extras: ['none'], dflt: 'end', - + editType: 'arraydraw', - + }, arrowsize: { valType: 'number', min: 0.3, dflt: 1, - + editType: 'calc+arraydraw', - + }, startarrowsize: { valType: 'number', min: 0.3, dflt: 1, - + editType: 'calc+arraydraw', - + }, arrowwidth: { valType: 'number', min: 0.1, - + editType: 'calc+arraydraw', - + }, standoff: { valType: 'number', min: 0, dflt: 0, - + editType: 'calc+arraydraw', - + }, startstandoff: { valType: 'number', min: 0, dflt: 0, - + editType: 'calc+arraydraw', - + }, ax: { valType: 'any', - + editType: 'calc+arraydraw', - + }, ay: { valType: 'any', - + editType: 'calc+arraydraw', - + }, axref: { valType: 'enumerated', @@ -83193,9 +83193,9 @@ module.exports = templatedArray('annotation', { 'pixel', cartesianConstants.idRegex.x.toString() ], - + editType: 'calc', - + }, ayref: { valType: 'enumerated', @@ -83204,9 +83204,9 @@ module.exports = templatedArray('annotation', { 'pixel', cartesianConstants.idRegex.y.toString() ], - + editType: 'calc', - + }, // positioning xref: { @@ -83215,30 +83215,30 @@ module.exports = templatedArray('annotation', { 'paper', cartesianConstants.idRegex.x.toString() ], - + editType: 'calc', - + }, x: { valType: 'any', - + editType: 'calc+arraydraw', - + }, xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'auto', - + editType: 'calc+arraydraw', - + }, xshift: { valType: 'number', dflt: 0, - + editType: 'calc+arraydraw', - + }, yref: { valType: 'enumerated', @@ -83246,90 +83246,90 @@ module.exports = templatedArray('annotation', { 'paper', cartesianConstants.idRegex.y.toString() ], - + editType: 'calc', - + }, y: { valType: 'any', - + editType: 'calc+arraydraw', - + }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], dflt: 'auto', - + editType: 'calc+arraydraw', - + }, yshift: { valType: 'number', dflt: 0, - + editType: 'calc+arraydraw', - + }, clicktoshow: { valType: 'enumerated', values: [false, 'onoff', 'onout'], dflt: false, - + editType: 'arraydraw', - + }, xclick: { valType: 'any', - + editType: 'arraydraw', - + }, yclick: { valType: 'any', - + editType: 'arraydraw', - + }, hovertext: { valType: 'string', - + editType: 'arraydraw', - + }, hoverlabel: { bgcolor: { valType: 'color', - + editType: 'arraydraw', - + }, bordercolor: { valType: 'color', - + editType: 'arraydraw', - + }, font: fontAttrs({ editType: 'arraydraw', - + }), editType: 'arraydraw' }, captureevents: { valType: 'boolean', - + editType: 'arraydraw', - + }, editType: 'calc', _deprecated: { ref: { valType: 'string', - + editType: 'calc', - + } } }); @@ -84715,28 +84715,28 @@ module.exports = overrideAll(templatedArray('annotation', { visible: annAttrs.visible, x: { valType: 'any', - - + + }, y: { valType: 'any', - - + + }, z: { valType: 'any', - - + + }, ax: { valType: 'number', - - + + }, ay: { valType: 'number', - - + + }, xanchor: annAttrs.xanchor, @@ -85079,7 +85079,7 @@ var ONEDAY = constants.ONEDAY; var attributes = { valType: 'enumerated', values: Object.keys(calendars.calendars), - + editType: 'calc', dflt: 'gregorian' }; @@ -85565,82 +85565,82 @@ module.exports = overrideAll({ // TODO: only right is supported currently // orient: { // valType: 'enumerated', -// +// // values: ['left', 'right', 'top', 'bottom'], // dflt: 'right', -// +// // }, thicknessmode: { valType: 'enumerated', values: ['fraction', 'pixels'], - + dflt: 'pixels', - + }, thickness: { valType: 'number', - + min: 0, dflt: 30, - + }, lenmode: { valType: 'enumerated', values: ['fraction', 'pixels'], - + dflt: 'fraction', - + }, len: { valType: 'number', min: 0, dflt: 1, - - + + }, x: { valType: 'number', dflt: 1.02, min: -2, max: 3, - - + + }, xanchor: { valType: 'enumerated', values: ['left', 'center', 'right'], dflt: 'left', - - + + }, xpad: { valType: 'number', - + min: 0, dflt: 10, - + }, y: { valType: 'number', - + dflt: 0.5, min: -2, max: 3, - + }, yanchor: { valType: 'enumerated', values: ['top', 'middle', 'bottom'], - + dflt: 'middle', - + }, ypad: { valType: 'number', - + min: 0, dflt: 10, - + }, // a possible line around the bar itself outlinecolor: axesAttrs.linecolor, @@ -85650,16 +85650,16 @@ module.exports = overrideAll({ bordercolor: axesAttrs.linecolor, borderwidth: { valType: 'number', - + min: 0, dflt: 0, - + }, bgcolor: { valType: 'color', - + dflt: 'rgba(0,0,0,0)', - + }, // tick and title properties named and function exactly as in axes tickmode: axesAttrs.tickmode, @@ -85674,7 +85674,7 @@ module.exports = overrideAll({ tickcolor: axesAttrs.tickcolor, showticklabels: axesAttrs.showticklabels, tickfont: fontAttrs({ - + }), tickangle: axesAttrs.tickangle, tickformat: axesAttrs.tickformat, @@ -85689,36 +85689,36 @@ module.exports = overrideAll({ title: { text: { valType: 'string', - - + + }, font: fontAttrs({ - + }), side: { valType: 'enumerated', values: ['right', 'top', 'bottom'], - + dflt: 'top', - + } }, _deprecated: { title: { valType: 'string', - - + + }, titlefont: fontAttrs({ - + }), titleside: { valType: 'enumerated', values: ['right', 'top', 'bottom'], - + dflt: 'top', - + } } }, 'colorbars', 'from-root'); @@ -86693,9 +86693,9 @@ module.exports = function colorScaleAttrs(context, opts) { attrs.color = { valType: 'color', arrayOk: true, - + editType: editTypeOverride || 'style', - + }; if(opts.anim) { @@ -86705,74 +86705,74 @@ module.exports = function colorScaleAttrs(context, opts) { attrs[auto] = { valType: 'boolean', - + dflt: true, editType: 'calc', impliedEdits: autoImpliedEdits, - + }; attrs[min] = { valType: 'number', - + dflt: null, editType: editTypeOverride || 'plot', impliedEdits: minmaxImpliedEdits, - + }; attrs[max] = { valType: 'number', - + dflt: null, editType: editTypeOverride || 'plot', impliedEdits: minmaxImpliedEdits, - + }; attrs[mid] = { valType: 'number', - + dflt: null, editType: 'calc', impliedEdits: autoImpliedEdits, - + }; attrs.colorscale = { valType: 'colorscale', - + editType: 'calc', dflt: colorscaleDflt, impliedEdits: {autocolorscale: false}, - + }; attrs.autocolorscale = { valType: 'boolean', - + // gets overrode in 'heatmap' & 'surface' for backwards comp. dflt: opts.autoColorDflt === false ? false : true, editType: 'calc', impliedEdits: {colorscale: undefined}, - + }; attrs.reversescale = { valType: 'boolean', - + dflt: false, editType: 'plot', - + }; if(!noScale) { attrs.showscale = { valType: 'boolean', - + dflt: showScaleDflt, editType: 'calc', - + }; attrs.colorbar = colorbarAttrs; @@ -86781,11 +86781,11 @@ module.exports = function colorScaleAttrs(context, opts) { if(!opts.noColorAxis) { attrs.coloraxis = { valType: 'subplotid', - + regex: counterRegex('coloraxis'), dflt: null, editType: 'calc', - + }; } @@ -87382,23 +87382,23 @@ module.exports = { sequential: { valType: 'colorscale', dflt: scales.Reds, - + editType: 'calc', - + }, sequentialminus: { valType: 'colorscale', dflt: scales.Blues, - + editType: 'calc', - + }, diverging: { valType: 'colorscale', dflt: scales.RdBu, - + editType: 'calc', - + } }, @@ -87408,7 +87408,7 @@ module.exports = { // support yaxis, yaxis2, yaxis3, ... counters _isSubplotObj: true, editType: 'calc', - + }, colorScaleAttrs('', { colorAttr: 'corresponding trace color array(s)', noColorAxis: true, @@ -88168,9 +88168,9 @@ exports.dash = { // dash lengths in px, and it will be honored values: ['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot'], dflt: 'solid', - + editType: 'style', - + }; },{}],617:[function(_dereq_,module,exports){ @@ -89864,102 +89864,102 @@ module.exports = { module.exports = { visible: { valType: 'boolean', - + editType: 'calc', - + }, type: { valType: 'enumerated', values: ['percent', 'constant', 'sqrt', 'data'], - + editType: 'calc', - + }, symmetric: { valType: 'boolean', - + editType: 'calc', - + }, array: { valType: 'data_array', editType: 'calc', - + }, arrayminus: { valType: 'data_array', editType: 'calc', - + }, value: { valType: 'number', min: 0, dflt: 10, - + editType: 'calc', - + }, valueminus: { valType: 'number', min: 0, dflt: 10, - + editType: 'calc', - + }, traceref: { valType: 'integer', min: 0, dflt: 0, - + editType: 'style' }, tracerefminus: { valType: 'integer', min: 0, dflt: 0, - + editType: 'style' }, copy_ystyle: { valType: 'boolean', - + editType: 'plot' }, copy_zstyle: { valType: 'boolean', - + editType: 'style' }, color: { valType: 'color', - + editType: 'style', - + }, thickness: { valType: 'number', min: 0, dflt: 2, - + editType: 'style', - + }, width: { valType: 'number', min: 0, - + editType: 'plot', - + }, editType: 'calc', _deprecated: { opacity: { valType: 'number', - + editType: 'style', - + } } }; @@ -90523,16 +90523,16 @@ module.exports = { hoverlabel: { bgcolor: extendFlat({}, hoverLabelAttrs.bgcolor, { arrayOk: true, - + }), bordercolor: extendFlat({}, hoverLabelAttrs.bordercolor, { arrayOk: true, - + }), font: fontAttrs({ arrayOk: true, editType: 'none', - + }), align: extendFlat({}, hoverLabelAttrs.align, {arrayOk: true}), namelength: extendFlat({}, hoverLabelAttrs.namelength, {arrayOk: true}), @@ -93006,7 +93006,7 @@ var constants = _dereq_('./constants'); var fontAttrs = _dereq_('../../plots/font_attributes')({ editType: 'none', - + }); fontAttrs.family.dflt = constants.HOVERFONT; fontAttrs.size.dflt = constants.HOVERFONTSIZE; @@ -93014,16 +93014,16 @@ fontAttrs.size.dflt = constants.HOVERFONTSIZE; module.exports = { clickmode: { valType: 'flaglist', - + flags: ['event', 'select'], dflt: 'event', editType: 'plot', extras: ['none'], - + }, dragmode: { valType: 'enumerated', - + values: [ 'zoom', 'pan', @@ -93040,69 +93040,69 @@ module.exports = { ], dflt: 'zoom', editType: 'modebar', - + }, hovermode: { valType: 'enumerated', - + values: ['x', 'y', 'closest', false, 'x unified', 'y unified'], editType: 'modebar', - + }, hoverdistance: { valType: 'integer', min: -1, dflt: 20, - + editType: 'none', - + }, spikedistance: { valType: 'integer', min: -1, dflt: 20, - + editType: 'none', - + }, hoverlabel: { bgcolor: { valType: 'color', - + editType: 'none', - + }, bordercolor: { valType: 'color', - + editType: 'none', - + }, font: fontAttrs, align: { valType: 'enumerated', values: ['left', 'right', 'auto'], dflt: 'auto', - + editType: 'none', - + }, namelength: { valType: 'integer', min: -1, dflt: 15, - + editType: 'none', - + }, editType: 'none' }, selectdirection: { valType: 'enumerated', - + values: ['h', 'v', 'd', 'any'], dflt: 'any', - + editType: 'none' } }; @@ -93199,92 +93199,92 @@ var gridAttrs = { rows: { valType: 'integer', min: 1, - + editType: 'plot', - + }, roworder: { valType: 'enumerated', values: ['top to bottom', 'bottom to top'], dflt: 'top to bottom', - + editType: 'plot', - + }, columns: { valType: 'integer', min: 1, - + editType: 'plot', - + }, subplots: { valType: 'info_array', freeLength: true, dimensions: 2, items: {valType: 'enumerated', values: [counterRegex('xy').toString(), ''], editType: 'plot'}, - + editType: 'plot', - + }, xaxes: { valType: 'info_array', freeLength: true, items: {valType: 'enumerated', values: [cartesianIdRegex.x.toString(), ''], editType: 'plot'}, - + editType: 'plot', - + }, yaxes: { valType: 'info_array', freeLength: true, items: {valType: 'enumerated', values: [cartesianIdRegex.y.toString(), ''], editType: 'plot'}, - + editType: 'plot', - + }, pattern: { valType: 'enumerated', values: ['independent', 'coupled'], dflt: 'coupled', - + editType: 'plot', - + }, xgap: { valType: 'number', min: 0, max: 1, - + editType: 'plot', - + }, ygap: { valType: 'number', min: 0, max: 1, - + editType: 'plot', - + }, domain: domainAttrs({name: 'grid', editType: 'plot', noGridCell: true}, { - + }), xside: { valType: 'enumerated', values: ['bottom', 'bottom plot', 'top plot', 'top'], dflt: 'bottom plot', - + editType: 'plot', - + }, yside: { valType: 'enumerated', values: ['left', 'left plot', 'right plot', 'right'], dflt: 'left plot', - + editType: 'plot', - + }, editType: 'plot' }; @@ -93570,95 +93570,95 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; module.exports = templatedArray('image', { visible: { valType: 'boolean', - + dflt: true, editType: 'arraydraw', - + }, source: { valType: 'string', - + editType: 'arraydraw', - + }, layer: { valType: 'enumerated', values: ['below', 'above'], dflt: 'above', - + editType: 'arraydraw', - + }, sizex: { valType: 'number', - + dflt: 0, editType: 'arraydraw', - + }, sizey: { valType: 'number', - + dflt: 0, editType: 'arraydraw', - + }, sizing: { valType: 'enumerated', values: ['fill', 'contain', 'stretch'], dflt: 'contain', - + editType: 'arraydraw', - + }, opacity: { valType: 'number', - + min: 0, max: 1, dflt: 1, editType: 'arraydraw', - + }, x: { valType: 'any', - + dflt: 0, editType: 'arraydraw', - + }, y: { valType: 'any', - + dflt: 0, editType: 'arraydraw', - + }, xanchor: { valType: 'enumerated', values: ['left', 'center', 'right'], dflt: 'left', - + editType: 'arraydraw', - + }, yanchor: { valType: 'enumerated', values: ['top', 'middle', 'bottom'], dflt: 'top', - + editType: 'arraydraw', - + }, xref: { @@ -93668,9 +93668,9 @@ module.exports = templatedArray('image', { cartesianConstants.idRegex.x.toString() ], dflt: 'paper', - + editType: 'arraydraw', - + }, yref: { @@ -93680,9 +93680,9 @@ module.exports = templatedArray('image', { cartesianConstants.idRegex.y.toString() ], dflt: 'paper', - + editType: 'arraydraw', - + }, editType: 'arraydraw' }); @@ -94100,123 +94100,123 @@ var colorAttrs = _dereq_('../color/attributes'); module.exports = { bgcolor: { valType: 'color', - + editType: 'legend', - + }, bordercolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'legend', - + }, borderwidth: { valType: 'number', min: 0, dflt: 0, - + editType: 'legend', - + }, font: fontAttrs({ editType: 'legend', - + }), orientation: { valType: 'enumerated', values: ['v', 'h'], dflt: 'v', - + editType: 'legend', - + }, traceorder: { valType: 'flaglist', flags: ['reversed', 'grouped'], extras: ['normal'], - + editType: 'legend', - + }, tracegroupgap: { valType: 'number', min: 0, dflt: 10, - + editType: 'legend', - + }, itemsizing: { valType: 'enumerated', values: ['trace', 'constant'], dflt: 'trace', - + editType: 'legend', - + }, itemclick: { valType: 'enumerated', values: ['toggle', 'toggleothers', false], dflt: 'toggle', - + editType: 'legend', - + }, itemdoubleclick: { valType: 'enumerated', values: ['toggle', 'toggleothers', false], dflt: 'toggleothers', - + editType: 'legend', - + }, x: { valType: 'number', min: -2, max: 3, - + editType: 'legend', - + }, xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'left', - + editType: 'legend', - + }, y: { valType: 'number', min: -2, max: 3, - + editType: 'legend', - + }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], - + editType: 'legend', - + }, uirevision: { valType: 'any', - + editType: 'none', - + }, valign: { valType: 'enumerated', values: ['top', 'middle', 'bottom'], dflt: 'middle', - + editType: 'legend', - + }, title: { text: { @@ -97627,51 +97627,51 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; var buttonAttrs = templatedArray('button', { visible: { valType: 'boolean', - + dflt: true, editType: 'plot', - + }, step: { valType: 'enumerated', - + values: ['month', 'year', 'day', 'hour', 'minute', 'second', 'all'], dflt: 'month', editType: 'plot', - + }, stepmode: { valType: 'enumerated', - + values: ['backward', 'todate'], dflt: 'backward', editType: 'plot', - + }, count: { valType: 'number', - + min: 0, dflt: 1, editType: 'plot', - + }, label: { valType: 'string', - + editType: 'plot', - + }, editType: 'plot', - + }); module.exports = { visible: { valType: 'boolean', - + editType: 'plot', - + }, buttons: buttonAttrs, @@ -97680,67 +97680,67 @@ module.exports = { valType: 'number', min: -2, max: 3, - + editType: 'plot', - + }, xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'left', - + editType: 'plot', - + }, y: { valType: 'number', min: -2, max: 3, - + editType: 'plot', - + }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], dflt: 'bottom', - + editType: 'plot', - + }, font: fontAttrs({ editType: 'plot', - + }), bgcolor: { valType: 'color', dflt: colorAttrs.lightLine, - + editType: 'plot', - + }, activecolor: { valType: 'color', - + editType: 'plot', - + }, bordercolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'plot', - + }, borderwidth: { valType: 'number', min: 0, dflt: 0, - + editType: 'plot', - + }, editType: 'plot' }; @@ -98221,59 +98221,59 @@ module.exports = { bgcolor: { valType: 'color', dflt: colorAttributes.background, - + editType: 'plot', - + }, bordercolor: { valType: 'color', dflt: colorAttributes.defaultLine, - + editType: 'plot', - + }, borderwidth: { valType: 'integer', dflt: 0, min: 0, - + editType: 'plot', - + }, autorange: { valType: 'boolean', dflt: true, - + editType: 'calc', impliedEdits: {'range[0]': undefined, 'range[1]': undefined}, - + }, range: { valType: 'info_array', - + items: [ {valType: 'any', editType: 'calc', impliedEdits: {'^autorange': false}}, {valType: 'any', editType: 'calc', impliedEdits: {'^autorange': false}} ], editType: 'calc', impliedEdits: {'autorange': false}, - + }, thickness: { valType: 'number', dflt: 0.15, min: 0, max: 1, - + editType: 'plot', - + }, visible: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, editType: 'calc' }; @@ -99224,19 +99224,19 @@ module.exports = { valType: 'enumerated', values: ['auto', 'fixed', 'match'], dflt: 'match', - + editType: 'calc', - + }, range: { valType: 'info_array', - + items: [ {valType: 'any', editType: 'plot'}, {valType: 'any', editType: 'plot'} ], editType: 'plot', - + }, editType: 'calc' }; @@ -99261,94 +99261,94 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; module.exports = templatedArray('shape', { visible: { valType: 'boolean', - + dflt: true, editType: 'calc+arraydraw', - + }, type: { valType: 'enumerated', values: ['circle', 'rect', 'path', 'line'], - + editType: 'calc+arraydraw', - + }, layer: { valType: 'enumerated', values: ['below', 'above'], dflt: 'above', - + editType: 'arraydraw', - + }, xref: extendFlat({}, annAttrs.xref, { - + }), xsizemode: { valType: 'enumerated', values: ['scaled', 'pixel'], dflt: 'scaled', - + editType: 'calc+arraydraw', - + }, xanchor: { valType: 'any', - + editType: 'calc+arraydraw', - + }, x0: { valType: 'any', - + editType: 'calc+arraydraw', - + }, x1: { valType: 'any', - + editType: 'calc+arraydraw', - + }, yref: extendFlat({}, annAttrs.yref, { - + }), ysizemode: { valType: 'enumerated', values: ['scaled', 'pixel'], dflt: 'scaled', - + editType: 'calc+arraydraw', - + }, yanchor: { valType: 'any', - + editType: 'calc+arraydraw', - + }, y0: { valType: 'any', - + editType: 'calc+arraydraw', - + }, y1: { valType: 'any', - + editType: 'calc+arraydraw', - + }, path: { valType: 'string', - + editType: 'calc+arraydraw', - + }, opacity: { @@ -99356,23 +99356,23 @@ module.exports = templatedArray('shape', { min: 0, max: 1, dflt: 1, - + editType: 'arraydraw', - + }, line: { color: extendFlat({}, scatterLineAttrs.color, {editType: 'arraydraw'}), width: extendFlat({}, scatterLineAttrs.width, {editType: 'calc+arraydraw'}), dash: extendFlat({}, dash, {editType: 'arraydraw'}), - + editType: 'calc+arraydraw' }, fillcolor: { valType: 'color', dflt: 'rgba(0,0,0,0)', - + editType: 'arraydraw', - + }, fillrule: { valType: 'enumerated', @@ -101708,60 +101708,60 @@ var constants = _dereq_('./constants'); var stepsAttrs = templatedArray('step', { visible: { valType: 'boolean', - + dflt: true, - + }, method: { valType: 'enumerated', values: ['restyle', 'relayout', 'animate', 'update', 'skip'], dflt: 'restyle', - - + + }, args: { valType: 'info_array', - + freeLength: true, items: [ { valType: 'any' }, { valType: 'any' }, { valType: 'any' } ], - + }, label: { valType: 'string', - - + + }, value: { valType: 'string', - - + + }, execute: { valType: 'boolean', - + dflt: true, - + } }); module.exports = overrideAll(templatedArray('slider', { visible: { valType: 'boolean', - + dflt: true, - + }, active: { valType: 'number', - + min: 0, dflt: 0, - + }, steps: stepsAttrs, @@ -101769,163 +101769,163 @@ module.exports = overrideAll(templatedArray('slider', { lenmode: { valType: 'enumerated', values: ['fraction', 'pixels'], - + dflt: 'fraction', - + }, len: { valType: 'number', min: 0, dflt: 1, - - + + }, x: { valType: 'number', min: -2, max: 3, dflt: 0, - - + + }, pad: extendDeepAll(padAttrs({editType: 'arraydraw'}), { - + }, {t: {dflt: 20}}), xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'left', - - + + }, y: { valType: 'number', min: -2, max: 3, dflt: 0, - - + + }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], dflt: 'top', - - + + }, transition: { duration: { valType: 'number', - + min: 0, dflt: 150, - + }, easing: { valType: 'enumerated', values: animationAttrs.transition.easing.values, - + dflt: 'cubic-in-out', - + } }, currentvalue: { visible: { valType: 'boolean', - + dflt: true, - + }, xanchor: { valType: 'enumerated', values: ['left', 'center', 'right'], dflt: 'left', - - + + }, offset: { valType: 'number', dflt: 10, - - + + }, prefix: { valType: 'string', - - + + }, suffix: { valType: 'string', - - + + }, font: fontAttrs({ - + }) }, font: fontAttrs({ - + }), activebgcolor: { valType: 'color', - + dflt: constants.gripBgActiveColor, - + }, bgcolor: { valType: 'color', - + dflt: constants.railBgColor, - + }, bordercolor: { valType: 'color', dflt: constants.railBorderColor, - - + + }, borderwidth: { valType: 'number', min: 0, dflt: constants.railBorderWidth, - - + + }, ticklen: { valType: 'number', min: 0, dflt: constants.tickLength, - - + + }, tickcolor: { valType: 'color', dflt: constants.tickColor, - - + + }, tickwidth: { valType: 'number', min: 0, dflt: 1, - - + + }, minorticklen: { valType: 'number', min: 0, dflt: constants.minorTickLength, - - + + } }), 'arraydraw', 'from-root'); @@ -103081,26 +103081,26 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; var buttonsAttrs = templatedArray('button', { visible: { valType: 'boolean', - - + + }, method: { valType: 'enumerated', values: ['restyle', 'relayout', 'animate', 'update', 'skip'], dflt: 'restyle', - - + + }, args: { valType: 'info_array', - + freeLength: true, items: [ {valType: 'any'}, {valType: 'any'}, {valType: 'any'} ], - + }, args2: { valType: 'info_array', @@ -103115,15 +103115,15 @@ var buttonsAttrs = templatedArray('button', { }, label: { valType: 'string', - + dflt: '', - + }, execute: { valType: 'boolean', - + dflt: true, - + } }); @@ -103132,39 +103132,39 @@ module.exports = overrideAll(templatedArray('updatemenu', { visible: { valType: 'boolean', - - + + }, type: { valType: 'enumerated', values: ['dropdown', 'buttons'], dflt: 'dropdown', - - + + }, direction: { valType: 'enumerated', values: ['left', 'right', 'up', 'down'], dflt: 'down', - - + + }, active: { valType: 'integer', - + min: -1, dflt: 0, - + }, showactive: { valType: 'boolean', - + dflt: true, - + }, buttons: buttonsAttrs, @@ -103174,58 +103174,58 @@ module.exports = overrideAll(templatedArray('updatemenu', { min: -2, max: 3, dflt: -0.05, - - + + }, xanchor: { valType: 'enumerated', values: ['auto', 'left', 'center', 'right'], dflt: 'right', - - + + }, y: { valType: 'number', min: -2, max: 3, dflt: 1, - - + + }, yanchor: { valType: 'enumerated', values: ['auto', 'top', 'middle', 'bottom'], dflt: 'top', - - + + }, pad: extendFlat(padAttrs({editType: 'arraydraw'}), { - + }), font: fontAttrs({ - + }), bgcolor: { valType: 'color', - - + + }, bordercolor: { valType: 'color', dflt: colorAttrs.borderLine, - - + + }, borderwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'arraydraw', - + } }), 'arraydraw', 'from-root'); @@ -105679,9 +105679,9 @@ var isArrayOrTypedArray = _dereq_('./array').isArrayOrTypedArray; exports.valObjectMeta = { data_array: { // You can use *dflt=[] to force said array to exist though. - - - + + + coerceFunction: function(v, propOut, dflt) { // TODO maybe `v: {type: 'float32', vals: [/* ... */]}` also if(isArrayOrTypedArray(v)) propOut.set(v); @@ -105689,9 +105689,9 @@ exports.valObjectMeta = { } }, enumerated: { - - - + + + coerceFunction: function(v, propOut, dflt, opts) { if(opts.coerceNumber) v = +v; if(opts.values.indexOf(v) === -1) propOut.set(dflt); @@ -105713,18 +105713,18 @@ exports.valObjectMeta = { } }, 'boolean': { - - - + + + coerceFunction: function(v, propOut, dflt) { if(v === true || v === false) propOut.set(v); else propOut.set(dflt); } }, number: { - - - + + + coerceFunction: function(v, propOut, dflt, opts) { if(!isNumeric(v) || (opts.min !== undefined && v < opts.min) || @@ -105734,9 +105734,9 @@ exports.valObjectMeta = { } }, integer: { - - - + + + coerceFunction: function(v, propOut, dflt, opts) { if(v % 1 || !isNumeric(v) || (opts.min !== undefined && v < opts.min) || @@ -105746,10 +105746,10 @@ exports.valObjectMeta = { } }, string: { - - + + // TODO 'values shouldn't be in there (edge case: 'dash' in Scatter) - + coerceFunction: function(v, propOut, dflt, opts) { if(typeof v !== 'string') { var okToCoerce = (typeof v === 'number'); @@ -105761,18 +105761,18 @@ exports.valObjectMeta = { } }, color: { - - - + + + coerceFunction: function(v, propOut, dflt) { if(tinycolor(v).isValid()) propOut.set(v); else propOut.set(dflt); } }, colorlist: { - - - + + + coerceFunction: function(v, propOut, dflt) { function isColor(color) { return tinycolor(color).isValid(); @@ -105783,17 +105783,17 @@ exports.valObjectMeta = { } }, colorscale: { - - - + + + coerceFunction: function(v, propOut, dflt) { propOut.set(colorscales.get(v, dflt)); } }, angle: { - - - + + + coerceFunction: function(v, propOut, dflt) { if(v === 'auto') propOut.set('auto'); else if(!isNumeric(v)) propOut.set(dflt); @@ -105801,9 +105801,9 @@ exports.valObjectMeta = { } }, subplotid: { - - - + + + coerceFunction: function(v, propOut, dflt, opts) { var regex = opts.regex || counterRegex(dflt); if(typeof v === 'string' && regex.test(v)) { @@ -105823,9 +105823,9 @@ exports.valObjectMeta = { } }, flaglist: { - - - + + + coerceFunction: function(v, propOut, dflt, opts) { if(typeof v !== 'string') { propOut.set(dflt); @@ -105848,23 +105848,23 @@ exports.valObjectMeta = { } }, any: { - - - + + + coerceFunction: function(v, propOut, dflt) { if(v === undefined) propOut.set(dflt); else propOut.set(v); } }, info_array: { - - + + // set `dimensions=2` for a 2D array or '1-2' for either // `items` may be a single object instead of an array, in which case // `freeLength` must be true. // if `dimensions='1-2'` and items is a 1D array, then the value can // either be a matching 1D array or an array of such matching 1D arrays - + coerceFunction: function(v, propOut, dflt, opts) { // simplified coerce function just for array items function coercePart(v, opts, dflt) { @@ -112621,7 +112621,7 @@ var traceOpts = { valType: 'flaglist', extras: ['none'], flags: ['calc', 'clearAxisTypes', 'plot', 'style', 'markerSize', 'colorbars'], - + }; var layoutOpts = { @@ -112631,7 +112631,7 @@ var layoutOpts = { 'calc', 'plot', 'legend', 'ticks', 'axrange', 'layoutstyle', 'modebar', 'camera', 'arraydraw', 'colorbars' ], - + }; // flags for inside restyle/relayout include a few extras @@ -113462,7 +113462,10 @@ var templateApi = _dereq_('./template_api'); exports.makeTemplate = templateApi.makeTemplate; exports.validateTemplate = templateApi.validateTemplate; -},{"../snapshot/download":861,"./plot_api":763,"./template_api":768,"./to_image":769,"./validate":770}],762:[function(_dereq_,module,exports){ +var zoomboxApi = _dereq_('./zoombox_api'); +exports.removeZoombox = zoomboxApi.removeZoombox; + +},{"../snapshot/download":861,"./plot_api":763,"./zoombox_api":784,"./template_api":768,"./to_image":769,"./validate":770}],762:[function(_dereq_,module,exports){ /** * Copyright 2012-2020, Plotly, Inc. * All rights reserved. @@ -117584,94 +117587,94 @@ var configAttributes = { staticPlot: { valType: 'boolean', dflt: false, - + }, plotlyServerURL: { valType: 'string', dflt: '', - + }, editable: { valType: 'boolean', dflt: false, - + }, edits: { annotationPosition: { valType: 'boolean', dflt: false, - + }, annotationTail: { valType: 'boolean', dflt: false, - + }, annotationText: { valType: 'boolean', dflt: false, - + }, axisTitleText: { valType: 'boolean', dflt: false, - + }, colorbarPosition: { valType: 'boolean', dflt: false, - + }, colorbarTitleText: { valType: 'boolean', dflt: false, - + }, legendPosition: { valType: 'boolean', dflt: false, - + }, legendText: { valType: 'boolean', dflt: false, - + }, shapePosition: { valType: 'boolean', dflt: false, - + }, titleText: { valType: 'boolean', dflt: false, - + } }, autosizable: { valType: 'boolean', dflt: false, - + }, responsive: { valType: 'boolean', dflt: false, - + }, fillFrame: { valType: 'boolean', dflt: false, - + }, frameMargins: { valType: 'number', dflt: 0, min: 0, max: 0.5, - + }, scrollZoom: { @@ -117679,105 +117682,105 @@ var configAttributes = { flags: ['cartesian', 'gl3d', 'geo', 'mapbox'], extras: [true, false], dflt: 'gl3d+geo+mapbox', - + }, doubleClick: { valType: 'enumerated', values: [false, 'reset', 'autosize', 'reset+autosize'], dflt: 'reset+autosize', - + }, doubleClickDelay: { valType: 'number', dflt: 300, min: 0, - + }, showAxisDragHandles: { valType: 'boolean', dflt: true, - + }, showAxisRangeEntryBoxes: { valType: 'boolean', dflt: true, - + }, showTips: { valType: 'boolean', dflt: true, - + }, showLink: { valType: 'boolean', dflt: false, - + }, linkText: { valType: 'string', dflt: 'Edit chart', noBlank: true, - + }, sendData: { valType: 'boolean', dflt: true, - + }, showSources: { valType: 'any', dflt: false, - + }, displayModeBar: { valType: 'enumerated', values: ['hover', true, false], dflt: 'hover', - + }, showSendToCloud: { valType: 'boolean', dflt: false, - + }, showEditInChartStudio: { valType: 'boolean', dflt: false, - + }, modeBarButtonsToRemove: { valType: 'any', dflt: [], - + }, modeBarButtonsToAdd: { valType: 'any', dflt: [], - + }, modeBarButtons: { valType: 'any', dflt: false, - + }, toImageButtonOptions: { valType: 'any', dflt: {}, - + }, displaylogo: { valType: 'boolean', dflt: true, - + }, watermark: { valType: 'boolean', dflt: false, - + }, plotGlPixelRatio: { @@ -117785,26 +117788,26 @@ var configAttributes = { dflt: 2, min: 1, max: 4, - + }, setBackground: { valType: 'any', dflt: 'transparent', - + }, topojsonURL: { valType: 'string', noBlank: true, dflt: 'https://cdn.plot.ly/', - + }, mapboxAccessToken: { valType: 'string', dflt: null, - + }, logging: { @@ -117812,7 +117815,7 @@ var configAttributes = { min: 0, max: 2, dflt: 1, - + }, notifyOnLogging: { @@ -117827,25 +117830,25 @@ var configAttributes = { valType: 'integer', min: 0, dflt: 0, - + }, globalTransforms: { valType: 'any', dflt: [], - + }, locale: { valType: 'string', dflt: 'en-US', - + }, locales: { valType: 'any', dflt: {}, - + } }; @@ -117949,7 +117952,7 @@ exports.get = function() { layout: editTypes.layout }, impliedEdits: { - + } }, @@ -118491,8 +118494,8 @@ function mergeValTypeAndRole(attrs) { function makeSrcAttr(attrName) { return { valType: 'string', - - + + editType: 'none' }; } @@ -118603,16 +118606,16 @@ var TEMPLATEITEMNAME = 'templateitemname'; var templateAttrs = { name: { valType: 'string', - + editType: 'none', - + } }; templateAttrs[TEMPLATEITEMNAME] = { valType: 'string', - + editType: 'calc', - + }; /** @@ -120130,33 +120133,33 @@ var attrs = { valType: 'enumerated', values: ['png', 'jpeg', 'webp', 'svg', 'full-json'], dflt: 'png', - + }, width: { valType: 'number', min: 1, - + }, height: { valType: 'number', min: 1, - + }, scale: { valType: 'number', min: 0, dflt: 1, - + }, setBackground: { valType: 'any', dflt: false, - + }, imageDataOnly: { valType: 'boolean', dflt: false, - + } }; @@ -120770,46 +120773,46 @@ module.exports = { mode: { valType: 'enumerated', dflt: 'afterall', - + values: ['immediate', 'next', 'afterall'], - + }, direction: { valType: 'enumerated', - + values: ['forward', 'reverse'], dflt: 'forward', - + }, fromcurrent: { valType: 'boolean', dflt: false, - - + + }, frame: { duration: { valType: 'number', - + min: 0, dflt: 500, - + }, redraw: { valType: 'boolean', - + dflt: true, - + }, }, transition: { duration: { valType: 'number', - + min: 0, dflt: 500, editType: 'none', - + }, easing: { valType: 'enumerated', @@ -120852,17 +120855,17 @@ module.exports = { 'back-in-out', 'bounce-in-out' ], - + editType: 'none', - + }, ordering: { valType: 'enumerated', values: ['layout first', 'traces first'], dflt: 'layout first', - + editType: 'none', - + } } }; @@ -120978,7 +120981,7 @@ var fxAttrs = _dereq_('../components/fx/attributes'); module.exports = { type: { valType: 'enumerated', - + values: [], // listed dynamically dflt: 'scatter', editType: 'calc+clearAxisTypes', @@ -120987,64 +120990,64 @@ module.exports = { visible: { valType: 'enumerated', values: [true, false, 'legendonly'], - + dflt: true, editType: 'calc', - + }, showlegend: { valType: 'boolean', - + dflt: true, editType: 'style', - + }, legendgroup: { valType: 'string', - + dflt: '', editType: 'style', - + }, opacity: { valType: 'number', - + min: 0, max: 1, dflt: 1, editType: 'style', - + }, name: { valType: 'string', - + editType: 'style', - + }, uid: { valType: 'string', - + editType: 'plot', anim: true, - + }, ids: { valType: 'data_array', editType: 'calc', anim: true, - + }, customdata: { valType: 'data_array', editType: 'calc', - + }, meta: { valType: 'any', arrayOk: true, - + editType: 'plot', - + }, // N.B. these cannot be 'data_array' as they do not have the same length as @@ -121054,20 +121057,20 @@ module.exports = { // https://github.com/plotly/plotly.js/issues/1894 selectedpoints: { valType: 'any', - + editType: 'calc', - + }, hoverinfo: { valType: 'flaglist', - + flags: ['x', 'y', 'z', 'text', 'name'], extras: ['all', 'none', 'skip'], arrayOk: true, dflt: 'all', editType: 'none', - + }, hoverlabel: fxAttrs.hoverlabel, stream: { @@ -121075,31 +121078,31 @@ module.exports = { valType: 'string', noBlank: true, strict: true, - + editType: 'calc', - + }, maxpoints: { valType: 'number', min: 0, max: 10000, dflt: 500, - + editType: 'calc', - + }, editType: 'calc' }, transforms: { _isLinkedToArray: 'transform', editType: 'calc', - + }, uirevision: { valType: 'any', - + editType: 'none', - + } }; @@ -121118,17 +121121,17 @@ module.exports = { module.exports = { xaxis: { valType: 'subplotid', - + dflt: 'x', editType: 'calc+clearAxisTypes', - + }, yaxis: { valType: 'subplotid', - + dflt: 'y', editType: 'calc+clearAxisTypes', - + } }; @@ -126438,6 +126441,18 @@ function makeDragBox(gd, plotinfo, x, y, w, h, ns, ew) { function zoomDone() { computeZoomUpdates(); + + var communicationObject = { + shouldContinue: true, + height: box.h, + width: box.w, + updates + } + dragOptions.gd.emit('plotly_zoomed', communicationObject); + if (!communicationObject.shouldContinue) { + return; + } + removeZoombox(gd); dragTail(); showDoubleClickNotifier(gd); @@ -127266,6 +127281,7 @@ module.exports = { attachWheelEventHandler: attachWheelEventHandler }; +exports.removeZoombox = removeZoombox; },{"../../components/color":595,"../../components/dragelement":614,"../../components/dragelement/helpers":613,"../../components/drawing":617,"../../components/fx":635,"../../constants/alignment":697,"../../lib":728,"../../lib/clear_gl_canvases":713,"../../lib/setcursor":748,"../../lib/svg_text_utils":752,"../../plot_api/subroutines":767,"../../registry":859,"../plots":839,"./axes":776,"./axis_ids":779,"./constants":782,"./scale_zoom":794,"./select":795,"d3":164,"has-passive-events":410,"tinycolor2":528}],785:[function(_dereq_,module,exports){ /** @@ -128244,27 +128260,27 @@ var DAY_OF_WEEK = constants.WEEKDAY_PATTERN; module.exports = { visible: { valType: 'boolean', - + editType: 'plot', - + }, color: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'ticks', - + }, title: { text: { valType: 'string', - + editType: 'ticks', - + }, font: fontAttrs({ editType: 'ticks', - + }), standoff: { valType: 'number', @@ -128282,35 +128298,35 @@ module.exports = { // to gd.data like the others are. values: ['-', 'linear', 'log', 'date', 'category', 'multicategory'], dflt: '-', - + editType: 'calc', // we forget when an axis has been autotyped, just writing the auto // value back to the input - so it doesn't make sense to template this. // Note: we do NOT prohibit this in `coerce`, so if someone enters a // type in the template explicitly it will be honored as the default. _noTemplating: true, - + }, autorange: { valType: 'enumerated', values: [true, false, 'reversed'], dflt: true, - + editType: 'axrange', impliedEdits: {'range[0]': undefined, 'range[1]': undefined}, - + }, rangemode: { valType: 'enumerated', values: ['normal', 'tozero', 'nonnegative'], dflt: 'normal', - + editType: 'plot', - + }, range: { valType: 'info_array', - + items: [ {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true}, {valType: 'any', editType: 'axrange', impliedEdits: {'^autorange': false}, anim: true} @@ -128318,14 +128334,14 @@ module.exports = { editType: 'axrange', impliedEdits: {'autorange': false}, anim: true, - + }, fixedrange: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, // scaleanchor: not used directly, just put here for reference // values are any opposite-letter axis id @@ -128335,33 +128351,33 @@ module.exports = { constants.idRegex.x.toString(), constants.idRegex.y.toString() ], - + editType: 'plot', - + }, scaleratio: { valType: 'number', min: 0, dflt: 1, - + editType: 'plot', - + }, constrain: { valType: 'enumerated', values: ['range', 'domain'], dflt: 'range', - + editType: 'plot', - + }, // constraintoward: not used directly, just put here for reference constraintoward: { valType: 'enumerated', values: ['left', 'center', 'right', 'top', 'middle', 'bottom'], - + editType: 'plot', - + }, matches: { valType: 'enumerated', @@ -128369,9 +128385,9 @@ module.exports = { constants.idRegex.x.toString(), constants.idRegex.y.toString() ], - + editType: 'calc', - + }, rangebreaks: templatedArray('rangebreak', { @@ -128455,331 +128471,331 @@ module.exports = { tickmode: { valType: 'enumerated', values: ['auto', 'linear', 'array'], - + editType: 'ticks', impliedEdits: {tick0: undefined, dtick: undefined}, - + }, nticks: { valType: 'integer', min: 0, dflt: 0, - + editType: 'ticks', - + }, tick0: { valType: 'any', - + editType: 'ticks', impliedEdits: {tickmode: 'linear'}, - + }, dtick: { valType: 'any', - + editType: 'ticks', impliedEdits: {tickmode: 'linear'}, - + }, tickvals: { valType: 'data_array', editType: 'ticks', - + }, ticktext: { valType: 'data_array', editType: 'ticks', - + }, ticks: { valType: 'enumerated', values: ['outside', 'inside', ''], - + editType: 'ticks', - + }, tickson: { valType: 'enumerated', values: ['labels', 'boundaries'], - + dflt: 'labels', editType: 'ticks', - + }, mirror: { valType: 'enumerated', values: [true, 'ticks', false, 'all', 'allticks'], dflt: false, - + editType: 'ticks+layoutstyle', - + }, ticklen: { valType: 'number', min: 0, dflt: 5, - + editType: 'ticks', - + }, tickwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'ticks', - + }, tickcolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'ticks', - + }, showticklabels: { valType: 'boolean', dflt: true, - + editType: 'ticks', - + }, automargin: { valType: 'boolean', dflt: false, - + editType: 'ticks', - + }, showspikes: { valType: 'boolean', dflt: false, - + editType: 'modebar', - + }, spikecolor: { valType: 'color', dflt: null, - + editType: 'none', - + }, spikethickness: { valType: 'number', dflt: 3, - + editType: 'none', - + }, spikedash: extendFlat({}, dash, {dflt: 'dash', editType: 'none'}), spikemode: { valType: 'flaglist', flags: ['toaxis', 'across', 'marker'], - + dflt: 'toaxis', editType: 'none', - + }, spikesnap: { valType: 'enumerated', values: ['data', 'cursor', 'hovered data'], dflt: 'data', - + editType: 'none', - + }, tickfont: fontAttrs({ editType: 'ticks', - + }), tickangle: { valType: 'angle', dflt: 'auto', - + editType: 'ticks', - + }, tickprefix: { valType: 'string', dflt: '', - + editType: 'ticks', - + }, showtickprefix: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'ticks', - + }, ticksuffix: { valType: 'string', dflt: '', - + editType: 'ticks', - + }, showticksuffix: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'ticks', - + }, showexponent: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'ticks', - + }, exponentformat: { valType: 'enumerated', values: ['none', 'e', 'E', 'power', 'SI', 'B'], dflt: 'B', - + editType: 'ticks', - + }, separatethousands: { valType: 'boolean', dflt: false, - + editType: 'ticks', - + }, tickformat: { valType: 'string', dflt: '', - + editType: 'ticks', - + }, tickformatstops: templatedArray('tickformatstop', { enabled: { valType: 'boolean', - + dflt: true, editType: 'ticks', - + }, dtickrange: { valType: 'info_array', - + items: [ {valType: 'any', editType: 'ticks'}, {valType: 'any', editType: 'ticks'} ], editType: 'ticks', - + }, value: { valType: 'string', dflt: '', - + editType: 'ticks', - + }, editType: 'ticks' }), hoverformat: { valType: 'string', dflt: '', - + editType: 'none', - + }, // lines and grids showline: { valType: 'boolean', dflt: false, - + editType: 'ticks+layoutstyle', - + }, linecolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'layoutstyle', - + }, linewidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'ticks+layoutstyle', - + }, showgrid: { valType: 'boolean', - + editType: 'ticks', - + }, gridcolor: { valType: 'color', dflt: colorAttrs.lightLine, - + editType: 'ticks', - + }, gridwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'ticks', - + }, zeroline: { valType: 'boolean', - + editType: 'ticks', - + }, zerolinecolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'ticks', - + }, zerolinewidth: { valType: 'number', dflt: 1, - + editType: 'ticks', - + }, showdividers: { valType: 'boolean', dflt: true, - + editType: 'ticks', - + }, dividercolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'ticks', - + }, dividerwidth: { valType: 'number', dflt: 1, - + editType: 'ticks', - + }, // TODO dividerlen: that would override "to label base" length? @@ -128793,18 +128809,18 @@ module.exports = { constants.idRegex.x.toString(), constants.idRegex.y.toString() ], - + editType: 'plot', - + }, // side: not used directly, as values depend on direction // values are top, bottom for x axes, and left, right for y side: { valType: 'enumerated', values: ['top', 'bottom', 'left', 'right'], - + editType: 'plot', - + }, // overlaying: not used directly, just put here for reference // values are false and any other same-letter axis id that's not @@ -128816,37 +128832,37 @@ module.exports = { constants.idRegex.x.toString(), constants.idRegex.y.toString() ], - + editType: 'plot', - + }, layer: { valType: 'enumerated', values: ['above traces', 'below traces'], dflt: 'above traces', - + editType: 'plot', - + }, domain: { valType: 'info_array', - + items: [ {valType: 'number', min: 0, max: 1, editType: 'plot'}, {valType: 'number', min: 0, max: 1, editType: 'plot'} ], dflt: [0, 1], editType: 'plot', - + }, position: { valType: 'number', min: 0, max: 1, dflt: 0, - + editType: 'plot', - + }, categoryorder: { valType: 'enumerated', @@ -128860,40 +128876,40 @@ module.exports = { 'median ascending', 'median descending' ], dflt: 'trace', - + editType: 'calc', - + }, categoryarray: { valType: 'data_array', - + editType: 'calc', - + }, uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'calc', _deprecated: { autotick: { valType: 'boolean', - + editType: 'ticks', - + }, title: { valType: 'string', - + editType: 'ticks', - + }, titlefont: fontAttrs({ editType: 'ticks', - + }) } }; @@ -132473,7 +132489,7 @@ exports.attributes = function(opts, extra) { var base = { valType: 'info_array', - + editType: opts.editType, items: [ {valType: 'number', min: 0, max: 1, editType: opts.editType}, @@ -132488,10 +132504,10 @@ exports.attributes = function(opts, extra) { var out = { x: extendFlat({}, base, { - + }), y: extendFlat({}, base, { - + }), editType: opts.editType }; @@ -132501,17 +132517,17 @@ exports.attributes = function(opts, extra) { valType: 'integer', min: 0, dflt: 0, - + editType: opts.editType, - + }; out.column = { valType: 'integer', min: 0, dflt: 0, - + editType: opts.editType, - + }; } @@ -132578,27 +132594,27 @@ module.exports = function(opts) { var attrs = { family: { valType: 'string', - + noBlank: true, strict: true, editType: editType, - + }, size: { valType: 'number', - + min: 1, editType: editType }, color: { valType: 'color', - + editType: colorEditType }, editType: editType, // blank strings so compress_attributes can remove // TODO - that's uber hacky... better solution? - + }; if(opts.arrayOk) { @@ -132626,33 +132642,33 @@ module.exports = { group: { valType: 'string', - - + + }, name: { valType: 'string', - - + + }, traces: { valType: 'any', - - + + }, baseframe: { valType: 'string', - - + + }, data: { valType: 'any', - - + + }, layout: { valType: 'any', - - + + } }; @@ -133687,10 +133703,10 @@ var counter = counterRegex(GEO); var attributes = {}; attributes[GEO] = { valType: 'subplotid', - + dflt: GEO, editType: 'calc', - + }; function plotGeo(gd) { @@ -133778,48 +133794,48 @@ var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; var geoAxesAttrs = { range: { valType: 'info_array', - + items: [ {valType: 'number'}, {valType: 'number'} ], - + }, showgrid: { valType: 'boolean', - + dflt: false, - + }, tick0: { valType: 'number', - + dflt: 0, - + }, dtick: { valType: 'number', - - + + }, gridcolor: { valType: 'color', - + dflt: colorAttrs.lightLine, - + }, gridwidth: { valType: 'number', - + min: 0, dflt: 1, - + } }; var attrs = module.exports = overrideAll({ domain: domainAttrs({name: 'geo'}, { - + }), fitbounds: { @@ -133834,69 +133850,69 @@ var attrs = module.exports = overrideAll({ resolution: { valType: 'enumerated', values: [110, 50], - + dflt: 110, coerceNumber: true, - + }, scope: { valType: 'enumerated', - + values: Object.keys(constants.scopeDefaults), dflt: 'world', - + }, projection: { type: { valType: 'enumerated', - + values: Object.keys(constants.projNames), - + }, rotation: { lon: { valType: 'number', - - + + }, lat: { valType: 'number', - - + + }, roll: { valType: 'number', - - + + } }, parallels: { valType: 'info_array', - + items: [ {valType: 'number'}, {valType: 'number'} ], - + }, scale: { valType: 'number', - + min: 0, dflt: 1, - + }, }, center: { lon: { valType: 'number', - - + + }, lat: { valType: 'number', - - + + } }, visible: { @@ -133907,136 +133923,136 @@ var attrs = module.exports = overrideAll({ }, showcoastlines: { valType: 'boolean', - - + + }, coastlinecolor: { valType: 'color', - + dflt: colorAttrs.defaultLine, - + }, coastlinewidth: { valType: 'number', - + min: 0, dflt: 1, - + }, showland: { valType: 'boolean', - + dflt: false, - + }, landcolor: { valType: 'color', - + dflt: constants.landColor, - + }, showocean: { valType: 'boolean', - + dflt: false, - + }, oceancolor: { valType: 'color', - + dflt: constants.waterColor, - + }, showlakes: { valType: 'boolean', - + dflt: false, - + }, lakecolor: { valType: 'color', - + dflt: constants.waterColor, - + }, showrivers: { valType: 'boolean', - + dflt: false, - + }, rivercolor: { valType: 'color', - + dflt: constants.waterColor, - + }, riverwidth: { valType: 'number', - + min: 0, dflt: 1, - + }, showcountries: { valType: 'boolean', - - + + }, countrycolor: { valType: 'color', - + dflt: colorAttrs.defaultLine, - + }, countrywidth: { valType: 'number', - + min: 0, dflt: 1, - + }, showsubunits: { valType: 'boolean', - - + + }, subunitcolor: { valType: 'color', - + dflt: colorAttrs.defaultLine, - + }, subunitwidth: { valType: 'number', - + min: 0, dflt: 1, - + }, showframe: { valType: 'boolean', - - + + }, framecolor: { valType: 'color', - + dflt: colorAttrs.defaultLine, - + }, framewidth: { valType: 'number', - + min: 0, dflt: 1, - + }, bgcolor: { valType: 'color', - + dflt: colorAttrs.background, - + }, lonaxis: geoAxesAttrs, lataxis: geoAxesAttrs @@ -134045,9 +134061,9 @@ var attrs = module.exports = overrideAll({ // set uirevision outside of overrideAll so it can be `editType: 'none'` attrs.uirevision = { valType: 'any', - + editType: 'none', - + }; },{"../../components/color/attributes":594,"../../plot_api/edit_types":759,"../domain":803,"./constants":806}],810:[function(_dereq_,module,exports){ @@ -136954,10 +136970,10 @@ exports.updateFx = function(gd) { module.exports = { scene: { valType: 'subplotid', - + dflt: 'scene', editType: 'calc+clearAxisTypes', - + } }; @@ -136981,46 +136997,46 @@ module.exports = overrideAll({ visible: axesAttrs.visible, showspikes: { valType: 'boolean', - + dflt: true, - + }, spikesides: { valType: 'boolean', - + dflt: true, - + }, spikethickness: { valType: 'number', - + min: 0, dflt: 2, - + }, spikecolor: { valType: 'color', - + dflt: Color.defaultLine, - + }, showbackground: { valType: 'boolean', - + dflt: false, - + }, backgroundcolor: { valType: 'color', - + dflt: 'rgba(204, 204, 204, 0.5)', - + }, showaxeslabels: { valType: 'boolean', - + dflt: true, - + }, color: axesAttrs.color, categoryorder: axesAttrs.categoryorder, @@ -137492,19 +137508,19 @@ function makeCameraVector(x, y, z) { return { x: { valType: 'number', - + dflt: x, editType: 'camera' }, y: { valType: 'number', - + dflt: y, editType: 'camera' }, z: { valType: 'number', - + dflt: z, editType: 'camera' }, @@ -137517,28 +137533,28 @@ module.exports = { bgcolor: { valType: 'color', - + dflt: 'rgba(0,0,0,0)', editType: 'plot' }, camera: { up: extendFlat(makeCameraVector(0, 0, 1), { - + }), center: extendFlat(makeCameraVector(0, 0, 0), { - + }), eye: extendFlat(makeCameraVector(1.25, 1.25, 1.25), { - + }), projection: { type: { valType: 'enumerated', - + values: ['perspective', 'orthographic'], dflt: 'perspective', editType: 'calc', - + }, editType: 'calc' }, @@ -137547,7 +137563,7 @@ module.exports = { domain: domainAttrs({name: 'scene', editType: 'plot'}), aspectmode: { valType: 'enumerated', - + values: ['auto', 'cube', 'data', 'manual'], dflt: 'auto', editType: 'plot', @@ -137556,33 +137572,33 @@ module.exports = { 'aspectratio.y': undefined, 'aspectratio.z': undefined }, - + }, aspectratio: { // must be positive (0's are coerced to 1) x: { valType: 'number', - + min: 0, editType: 'plot', impliedEdits: {'^aspectmode': 'manual'} }, y: { valType: 'number', - + min: 0, editType: 'plot', impliedEdits: {'^aspectmode': 'manual'} }, z: { valType: 'number', - + min: 0, editType: 'plot', impliedEdits: {'^aspectmode': 'manual'} }, editType: 'plot', impliedEdits: {aspectmode: 'manual'}, - + }, xaxis: gl3dAxisAttrs, @@ -137591,33 +137607,33 @@ module.exports = { dragmode: { valType: 'enumerated', - + values: ['orbit', 'turntable', 'zoom', 'pan', false], editType: 'plot', - + }, hovermode: { valType: 'enumerated', - + values: ['closest', false], dflt: 'closest', editType: 'modebar', - + }, uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'plot', _deprecated: { cameraposition: { valType: 'info_array', - + editType: 'camera', - + } } }; @@ -138974,7 +138990,7 @@ var extendFlat = _dereq_('../lib/extend').extendFlat; var globalFont = fontAttrs({ editType: 'calc', - + }); globalFont.family.dflt = '"Open Sans", verdana, arial, sans-serif'; globalFont.size.dflt = 12; @@ -138985,66 +139001,66 @@ module.exports = { title: { text: { valType: 'string', - + editType: 'layoutstyle', - + }, font: fontAttrs({ editType: 'layoutstyle', - + }), xref: { valType: 'enumerated', dflt: 'container', values: ['container', 'paper'], - + editType: 'layoutstyle', - + }, yref: { valType: 'enumerated', dflt: 'container', values: ['container', 'paper'], - + editType: 'layoutstyle', - + }, x: { valType: 'number', min: 0, max: 1, dflt: 0.5, - + editType: 'layoutstyle', - + }, y: { valType: 'number', min: 0, max: 1, dflt: 'auto', - + editType: 'layoutstyle', - + }, xanchor: { valType: 'enumerated', dflt: 'auto', values: ['auto', 'left', 'center', 'right'], - + editType: 'layoutstyle', - + }, yanchor: { valType: 'enumerated', dflt: 'auto', values: ['auto', 'top', 'middle', 'bottom'], - + editType: 'layoutstyle', - + }, pad: extendFlat(padAttrs({editType: 'layoutstyle'}), { - + }), editType: 'layoutstyle' }, @@ -139069,73 +139085,73 @@ module.exports = { }, autosize: { valType: 'boolean', - + dflt: false, // autosize, width, and height get special editType treatment in _relayout // so we can handle noop resizes more efficiently editType: 'none', - + }, width: { valType: 'number', - + min: 10, dflt: 700, editType: 'plot', - + }, height: { valType: 'number', - + min: 10, dflt: 450, editType: 'plot', - + }, margin: { l: { valType: 'number', - + min: 0, dflt: 80, editType: 'plot', - + }, r: { valType: 'number', - + min: 0, dflt: 80, editType: 'plot', - + }, t: { valType: 'number', - + min: 0, dflt: 100, editType: 'plot', - + }, b: { valType: 'number', - + min: 0, dflt: 80, editType: 'plot', - + }, pad: { valType: 'number', - + min: 0, dflt: 0, editType: 'plot', - + }, autoexpand: { valType: 'boolean', - + dflt: true, editType: 'plot', @@ -139144,110 +139160,110 @@ module.exports = { }, paper_bgcolor: { valType: 'color', - + dflt: colorAttrs.background, editType: 'plot', - + }, plot_bgcolor: { // defined here, but set in cartesian.supplyLayoutDefaults // because it needs to know if there are (2D) axes or not valType: 'color', - + dflt: colorAttrs.background, editType: 'layoutstyle', - + }, separators: { valType: 'string', - + editType: 'plot', - + }, hidesources: { valType: 'boolean', - + dflt: false, editType: 'plot', - + }, showlegend: { // handled in legend.supplyLayoutDefaults // but included here because it's not in the legend object valType: 'boolean', - + editType: 'legend', - + }, colorway: { valType: 'colorlist', dflt: colorAttrs.defaults, - + editType: 'calc', - + }, datarevision: { valType: 'any', - + editType: 'calc', - + }, uirevision: { valType: 'any', - + editType: 'none', - + }, editrevision: { valType: 'any', - + editType: 'none', - + }, selectionrevision: { valType: 'any', - + editType: 'none', - + }, template: { valType: 'any', - + editType: 'calc', - + }, modebar: { orientation: { valType: 'enumerated', values: ['v', 'h'], dflt: 'h', - + editType: 'modebar', - + }, bgcolor: { valType: 'color', - + editType: 'modebar', - + }, color: { valType: 'color', - + editType: 'modebar', - + }, activecolor: { valType: 'color', - + editType: 'modebar', - + }, uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'modebar' }, @@ -139258,25 +139274,25 @@ module.exports = { meta: { valType: 'any', arrayOk: true, - + editType: 'plot', - + }, transition: extendFlat({}, animationAttrs.transition, { - + editType: 'none' }), _deprecated: { title: { valType: 'string', - + editType: 'layoutstyle', - + }, titlefont: fontAttrs({ editType: 'layoutstyle', - + }) } }; @@ -139625,10 +139641,10 @@ exports.idRegex = exports.attrRegex = Lib.counterRegex(MAPBOX); exports.attributes = { subplot: { valType: 'subplotid', - + dflt: 'mapbox', editType: 'calc', - + } }; @@ -140192,7 +140208,7 @@ var templatedArray = _dereq_('../../plot_api/plot_template').templatedArray; var constants = _dereq_('./constants'); var fontAttr = fontAttrs({ - + }); fontAttr.family.dflt = 'Open Sans Regular, Arial Unicode MS Regular'; @@ -140205,133 +140221,133 @@ var attrs = module.exports = overrideAll({ valType: 'string', noBlank: true, strict: true, - - + + }, style: { valType: 'any', values: constants.styleValuesMapbox.concat(constants.styleValuesNonMapbox), dflt: constants.styleValueDflt, - - + + }, center: { lon: { valType: 'number', dflt: 0, - - + + }, lat: { valType: 'number', dflt: 0, - - + + } }, zoom: { valType: 'number', dflt: 1, - - + + }, bearing: { valType: 'number', dflt: 0, - - + + }, pitch: { valType: 'number', dflt: 0, - - + + }, layers: templatedArray('layer', { visible: { valType: 'boolean', - + dflt: true, - + }, sourcetype: { valType: 'enumerated', values: ['geojson', 'vector', 'raster', 'image'], dflt: 'geojson', - - + + }, source: { valType: 'any', - - + + }, sourcelayer: { valType: 'string', dflt: '', - - + + }, sourceattribution: { valType: 'string', - - + + }, type: { valType: 'enumerated', values: ['circle', 'line', 'fill', 'symbol', 'raster'], dflt: 'circle', - - + + }, coordinates: { valType: 'any', - - + + }, // attributes shared between all types below: { valType: 'string', - - + + }, color: { valType: 'color', dflt: defaultLine, - - + + }, opacity: { valType: 'number', min: 0, max: 1, dflt: 1, - - + + }, minzoom: { valType: 'number', min: 0, max: 24, dflt: 0, - - + + }, maxzoom: { valType: 'number', min: 0, max: 24, dflt: 24, - - + + }, // type-specific style attributes @@ -140339,8 +140355,8 @@ var attrs = module.exports = overrideAll({ radius: { valType: 'number', dflt: 15, - - + + } }, @@ -140348,13 +140364,13 @@ var attrs = module.exports = overrideAll({ width: { valType: 'number', dflt: 2, - - + + }, dash: { valType: 'data_array', - - + + } }, @@ -140362,8 +140378,8 @@ var attrs = module.exports = overrideAll({ outlinecolor: { valType: 'color', dflt: defaultLine, - - + + } }, @@ -140371,27 +140387,27 @@ var attrs = module.exports = overrideAll({ icon: { valType: 'string', dflt: 'marker', - - + + }, iconsize: { valType: 'number', dflt: 10, - - + + }, text: { valType: 'string', dflt: '', - - + + }, placement: { valType: 'enumerated', values: ['point', 'line', 'line-center'], dflt: 'point', - - + + }, textfont: fontAttr, textposition: Lib.extendFlat({}, textposition, { arrayOk: false }) @@ -140402,9 +140418,9 @@ var attrs = module.exports = overrideAll({ // set uirevision outside of overrideAll so it can be `editType: 'none'` attrs.uirevision = { valType: 'any', - + editType: 'none', - + }; },{"../../components/color":595,"../../lib":728,"../../plot_api/edit_types":759,"../../plot_api/plot_template":766,"../../traces/scatter/attributes":1134,"../domain":803,"../font_attributes":804,"./constants":831}],836:[function(_dereq_,module,exports){ @@ -141352,30 +141368,30 @@ module.exports = function(opts) { t: { valType: 'number', dflt: 0, - + editType: editType, - + }, r: { valType: 'number', dflt: 0, - + editType: editType, - + }, b: { valType: 'number', dflt: 0, - + editType: editType, - + }, l: { valType: 'number', dflt: 0, - + editType: editType, - + }, editType: editType }; @@ -145080,10 +145096,10 @@ var counter = counterRegex(name); var attributes = {}; attributes[attr] = { valType: 'subplotid', - + dflt: name, editType: 'calc', - + }; function plot(gd) { @@ -145214,9 +145230,9 @@ var radialAxisAttrs = { valType: 'enumerated', values: ['tozero', 'nonnegative', 'normal'], dflt: 'tozero', - + editType: 'calc', - + }, range: extendFlat({}, axesAttrs.range, { items: [ @@ -145232,8 +145248,8 @@ var radialAxisAttrs = { angle: { valType: 'angle', editType: 'plot', - - + + }, side: { @@ -145242,8 +145258,8 @@ var radialAxisAttrs = { values: ['clockwise', 'counterclockwise'], dflt: 'clockwise', editType: 'plot', - - + + }, @@ -145264,9 +145280,9 @@ var radialAxisAttrs = { uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'calc', @@ -145298,10 +145314,10 @@ var angularAxisAttrs = { // no 'log' for now values: ['-', 'linear', 'category'], dflt: '-', - + editType: 'calc', _noTemplating: true, - + }, categoryorder: axesAttrs.categoryorder, @@ -145311,17 +145327,17 @@ var angularAxisAttrs = { valType: 'enumerated', values: ['radians', 'degrees'], dflt: 'degrees', - + editType: 'calc', - + }, period: { valType: 'number', editType: 'calc', min: 0, - - + + // Examples for date axes: // // - period that equals the timeseries length @@ -145338,25 +145354,25 @@ var angularAxisAttrs = { valType: 'enumerated', values: ['counterclockwise', 'clockwise'], dflt: 'counterclockwise', - + editType: 'calc', - + }, rotation: { valType: 'angle', editType: 'calc', - - + + }, hoverformat: axesAttrs.hoverformat, uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'calc' @@ -145388,9 +145404,9 @@ module.exports = { {valType: 'number', editType: 'plot'} ], dflt: [0, 360], - + editType: 'plot', - + }, hole: { valType: 'number', @@ -145398,16 +145414,16 @@ module.exports = { max: 1, dflt: 0, editType: 'plot', - - + + }, bgcolor: { valType: 'color', - + editType: 'plot', dflt: colorAttrs.background, - + }, radialaxis: radialAxisAttrs, @@ -145417,9 +145433,9 @@ module.exports = { valType: 'enumerated', values: ['circular', 'linear'], dflt: 'circular', - + editType: 'plot', - + }, // TODO maybe? @@ -145427,9 +145443,9 @@ module.exports = { uirevision: { valType: 'any', - + editType: 'none', - + }, editType: 'calc' @@ -145690,23 +145706,23 @@ var deprecationWarning = [ module.exports = { r: extendFlat({}, scatterAttrs.r, { - + }), t: extendFlat({}, scatterAttrs.t, { - + }), marker: { color: extendFlat({}, scatterMarkerAttrs.color, { - + }), size: extendFlat({}, scatterMarkerAttrs.size, { - + }), symbol: extendFlat({}, scatterMarkerAttrs.symbol, { - + }), opacity: extendFlat({}, scatterMarkerAttrs.opacity, { - + }), editType: 'calc' } @@ -145734,52 +145750,52 @@ var deprecationWarning = [ ].join(' '); var domainAttr = extendFlat({}, axesAttrs.domain, { - + }); function mergeAttrs(axisName, nonCommonAttrs) { var commonAttrs = { showline: { valType: 'boolean', - - + + }, showticklabels: { valType: 'boolean', - - + + }, tickorientation: { valType: 'enumerated', values: ['horizontal', 'vertical'], - - + + }, ticklen: { valType: 'number', min: 0, - - + + }, tickcolor: { valType: 'color', - - + + }, ticksuffix: { valType: 'string', - - + + }, endpadding: { valType: 'number', - + description: deprecationWarning, }, visible: { valType: 'boolean', - - + + } }; @@ -145790,30 +145806,30 @@ module.exports = overrideAll({ radialaxis: mergeAttrs('radial', { range: { valType: 'info_array', - + items: [ { valType: 'number' }, { valType: 'number' } ], - + }, domain: domainAttr, orientation: { valType: 'number', - - + + } }), angularaxis: mergeAttrs('angular', { range: { valType: 'info_array', - + items: [ { valType: 'number', dflt: 0 }, { valType: 'number', dflt: 360 } ], - + }, domain: domainAttr }), @@ -145823,13 +145839,13 @@ module.exports = overrideAll({ direction: { valType: 'enumerated', values: ['clockwise', 'counterclockwise'], - - + + }, orientation: { valType: 'angle', - - + + } } }, 'plot', 'nested'); @@ -149244,10 +149260,10 @@ exports.idRegex = exports.attrRegex = counterRegex(TERNARY); var attributes = exports.attributes = {}; attributes[attr] = { valType: 'subplotid', - + dflt: 'ternary', editType: 'calc', - + }; exports.layoutAttributes = _dereq_('./layout_attributes'); @@ -149360,9 +149376,9 @@ var ternaryAxesAttrs = { min: { valType: 'number', dflt: 0, - + min: 0, - + }, _deprecated: { title: axesAttrs._deprecated.title, @@ -149375,16 +149391,16 @@ var attrs = module.exports = overrideAll({ bgcolor: { valType: 'color', - + dflt: colorAttrs.background, - + }, sum: { valType: 'number', - + dflt: 1, min: 0, - + }, aaxis: ternaryAxesAttrs, baxis: ternaryAxesAttrs, @@ -149394,16 +149410,16 @@ var attrs = module.exports = overrideAll({ // set uirevisions outside of `overrideAll` so we can get `editType: none` attrs.uirevision = { valType: 'any', - + editType: 'none', - + }; attrs.aaxis.uirevision = attrs.baxis.uirevision = attrs.caxis.uirevision = { valType: 'any', - + editType: 'none', - + }; },{"../../components/color/attributes":594,"../../lib/extend":719,"../../plot_api/edit_types":759,"../cartesian/layout_attributes":790,"../domain":803}],857:[function(_dereq_,module,exports){ @@ -151654,7 +151670,7 @@ var textFontAttrs = fontAttrs({ editType: 'calc', arrayOk: true, colorEditType: 'style', - + }); var scatterMarkerAttrs = scatterAttrs.marker; @@ -151678,9 +151694,9 @@ var marker = extendFlat({ dflt: 1, min: 0, max: 1, - + editType: 'style', - + } }); @@ -151703,80 +151719,80 @@ module.exports = { textposition: { valType: 'enumerated', - + values: ['inside', 'outside', 'auto', 'none'], dflt: 'none', arrayOk: true, editType: 'calc', - + }, insidetextanchor: { valType: 'enumerated', values: ['end', 'middle', 'start'], dflt: 'end', - + editType: 'plot', - + }, textangle: { valType: 'angle', dflt: 'auto', - + editType: 'plot', - + }, textfont: extendFlat({}, textFontAttrs, { - + }), insidetextfont: extendFlat({}, textFontAttrs, { - + }), outsidetextfont: extendFlat({}, textFontAttrs, { - + }), constraintext: { valType: 'enumerated', values: ['inside', 'outside', 'both', 'none'], - + dflt: 'both', editType: 'calc', - + }, cliponaxis: extendFlat({}, scatterAttrs.cliponaxis, { - + }), orientation: { valType: 'enumerated', - + values: ['v', 'h'], editType: 'calc+clearAxisTypes', - + }, base: { valType: 'any', dflt: null, arrayOk: true, - + editType: 'calc', - + }, offset: { valType: 'number', dflt: null, arrayOk: true, - + editType: 'calc', - + }, width: { @@ -151784,26 +151800,26 @@ module.exports = { dflt: null, min: 0, arrayOk: true, - + editType: 'calc', - + }, marker: marker, offsetgroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, alignmentgroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, selected: { @@ -151831,10 +151847,10 @@ module.exports = { _deprecated: { bardir: { valType: 'enumerated', - + editType: 'calc', values: ['v', 'h'], - + } } }; @@ -153222,7 +153238,7 @@ module.exports = { categories: ['bar-like', 'cartesian', 'svg', 'bar', 'oriented', 'errorBarsOK', 'showLegend', 'zoomScale'], animatable: true, meta: { - + } }; @@ -153243,34 +153259,34 @@ module.exports = { valType: 'enumerated', values: ['stack', 'group', 'overlay', 'relative'], dflt: 'group', - + editType: 'calc', - + }, barnorm: { valType: 'enumerated', values: ['', 'fraction', 'percent'], dflt: '', - + editType: 'calc', - + }, bargap: { valType: 'number', min: 0, max: 1, - + editType: 'calc', - + }, bargroupgap: { valType: 'number', min: 0, max: 1, dflt: 0, - + editType: 'calc', - + } }; @@ -154627,27 +154643,27 @@ module.exports = { // orientation: { // valType: 'enumerated', - // + // // values: ['radial', 'angular'], // editType: 'calc+clearAxisTypes', - // + // // }, base: extendFlat({}, barAttrs.base, { - + }), offset: extendFlat({}, barAttrs.offset, { - + }), width: extendFlat({}, barAttrs.width, { - + }), text: extendFlat({}, barAttrs.text, { - + }), hovertext: extendFlat({}, barAttrs.hovertext, { - + }), // textposition: {}, @@ -154951,8 +154967,8 @@ module.exports = { selectPoints: _dereq_('../bar/select'), meta: { - - + + } }; @@ -154972,18 +154988,18 @@ module.exports = { valType: 'enumerated', values: ['stack', 'overlay'], dflt: 'stack', - + editType: 'calc', - + }, bargap: { valType: 'number', dflt: 0.1, min: 0, max: 1, - + editType: 'calc', - + } }; @@ -155154,24 +155170,24 @@ module.exports = { y: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, x: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, x0: { valType: 'any', - + editType: 'calc+clearAxisTypes', - + }, y0: { valType: 'any', - + editType: 'calc+clearAxisTypes', - + }, dx: { @@ -155189,9 +155205,9 @@ module.exports = { name: { valType: 'string', - + editType: 'calc+clearAxisTypes', - + }, q1: { @@ -155204,13 +155220,13 @@ module.exports = { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, q3: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, lowerfence: { valType: 'data_array', @@ -155220,25 +155236,25 @@ module.exports = { }, upperfence: { valType: 'data_array', - + editType: 'calc', - + }, notched: { valType: 'boolean', - + editType: 'calc', - + }, notchwidth: { valType: 'number', min: 0, max: 0.5, dflt: 0.25, - + editType: 'calc', - + }, notchspan: { valType: 'data_array', @@ -155255,25 +155271,25 @@ module.exports = { boxpoints: { valType: 'enumerated', values: ['all', 'outliers', 'suspectedoutliers', false], - + editType: 'calc', - + }, jitter: { valType: 'number', min: 0, max: 1, - + editType: 'calc', - + }, pointpos: { valType: 'number', min: -2, max: 2, - + editType: 'calc', - + }, boxmean: { @@ -155299,9 +155315,9 @@ module.exports = { orientation: { valType: 'enumerated', values: ['v', 'h'], - + editType: 'calc+clearAxisTypes', - + }, quartilemethod: { @@ -155316,19 +155332,19 @@ module.exports = { width: { valType: 'number', min: 0, - + dflt: 0, editType: 'calc', - + }, marker: { outliercolor: { valType: 'color', dflt: 'rgba(0, 0, 0, 0)', - + editType: 'style', - + }, symbol: extendFlat({}, scatterMarkerAttrs.symbol, {arrayOk: false, editType: 'plot'}), @@ -155347,17 +155363,17 @@ module.exports = { ), outliercolor: { valType: 'color', - + editType: 'style', - + }, outlierwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'style', - + }, editType: 'style' }, @@ -155367,17 +155383,17 @@ module.exports = { line: { color: { valType: 'color', - + editType: 'style', - + }, width: { valType: 'number', - + min: 0, dflt: 2, editType: 'style', - + }, editType: 'plot' }, @@ -155420,9 +155436,9 @@ module.exports = { valType: 'flaglist', flags: ['boxes', 'points'], dflt: 'boxes+points', - + editType: 'style', - + } }; @@ -156747,7 +156763,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale'], meta: { - + } }; @@ -156768,27 +156784,27 @@ module.exports = { valType: 'enumerated', values: ['group', 'overlay'], dflt: 'overlay', - + editType: 'calc', - + }, boxgap: { valType: 'number', min: 0, max: 1, dflt: 0.3, - + editType: 'calc', - + }, boxgroupgap: { valType: 'number', min: 0, max: 1, dflt: 0.3, - + editType: 'calc', - + } }; @@ -157349,7 +157365,7 @@ module.exports = { line: { width: extendFlat({}, boxAttrs.line.width, { - + }), editType: 'style' }, @@ -157478,7 +157494,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'showLegend', 'candlestick', 'boxLayout'], meta: { - + }, attributes: _dereq_('./attributes'), @@ -157622,7 +157638,7 @@ var colorAttrs = _dereq_('../../components/color/attributes'); var carpetFont = fontAttrs({ editType: 'calc', - + }); // TODO: inherit from global font carpetFont.family.dflt = '"Open Sans", verdana, arial, sans-serif'; @@ -157632,64 +157648,64 @@ carpetFont.color.dflt = colorAttrs.defaultLine; module.exports = { carpet: { valType: 'string', - + editType: 'calc', - + }, x: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, y: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, a: { valType: 'data_array', editType: 'calc', - + }, a0: { valType: 'number', dflt: 0, - + editType: 'calc', - + }, da: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, b: { valType: 'data_array', editType: 'calc', - + }, b0: { valType: 'number', dflt: 0, - + editType: 'calc', - + }, db: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, cheaterslope: { valType: 'number', - + dflt: 1, editType: 'calc', - + }, aaxis: axisAttrs, baxis: axisAttrs, @@ -157697,9 +157713,9 @@ module.exports = { color: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'plot', - + }, transforms: undefined }; @@ -157833,37 +157849,37 @@ var DATE_FORMAT_LINK = _dereq_('../../constants/docs').TIME_FORMAT_LINK; module.exports = { color: { valType: 'color', - + editType: 'calc', - + }, smoothing: { valType: 'number', dflt: 1, min: 0, max: 1.3, - + editType: 'calc' }, title: { text: { valType: 'string', dflt: '', - + editType: 'calc', - + }, font: fontAttrs({ editType: 'calc', - + }), // TODO how is this different than `title.standoff` offset: { valType: 'number', - + dflt: 10, editType: 'calc', - + }, editType: 'calc', }, @@ -157874,154 +157890,154 @@ module.exports = { // to gd.data like the others are. values: ['-', 'linear', 'date', 'category'], dflt: '-', - + editType: 'calc', - + }, autorange: { valType: 'enumerated', values: [true, false, 'reversed'], dflt: true, - + editType: 'calc', - + }, rangemode: { valType: 'enumerated', values: ['normal', 'tozero', 'nonnegative'], dflt: 'normal', - + editType: 'calc', - + }, range: { valType: 'info_array', - + editType: 'calc', items: [ {valType: 'any', editType: 'calc'}, {valType: 'any', editType: 'calc'} ], - + }, fixedrange: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, cheatertype: { valType: 'enumerated', values: ['index', 'value'], dflt: 'value', - + editType: 'calc' }, tickmode: { valType: 'enumerated', values: ['linear', 'array'], dflt: 'array', - + editType: 'calc' }, nticks: { valType: 'integer', min: 0, dflt: 0, - + editType: 'calc', - + }, tickvals: { valType: 'data_array', editType: 'calc', - + }, ticktext: { valType: 'data_array', editType: 'calc', - + }, showticklabels: { valType: 'enumerated', values: ['start', 'end', 'both', 'none'], dflt: 'start', - + editType: 'calc', - + }, tickfont: fontAttrs({ editType: 'calc', - + }), tickangle: { valType: 'angle', dflt: 'auto', - + editType: 'calc', - + }, tickprefix: { valType: 'string', dflt: '', - + editType: 'calc', - + }, showtickprefix: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'calc', - + }, ticksuffix: { valType: 'string', dflt: '', - + editType: 'calc', - + }, showticksuffix: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'calc', - + }, showexponent: { valType: 'enumerated', values: ['all', 'first', 'last', 'none'], dflt: 'all', - + editType: 'calc', - + }, exponentformat: { valType: 'enumerated', values: ['none', 'e', 'E', 'power', 'SI', 'B'], dflt: 'B', - + editType: 'calc', - + }, separatethousands: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, tickformat: { valType: 'string', dflt: '', - + editType: 'calc', - + }, tickformatstops: overrideAll(axesAttrs.tickformatstops, 'calc', 'from-root'), categoryorder: { @@ -158031,191 +158047,191 @@ module.exports = { /* , 'value ascending', 'value descending'*/ // value ascending / descending to be implemented later ], dflt: 'trace', - + editType: 'calc', - + }, categoryarray: { valType: 'data_array', - + editType: 'calc', - + }, labelpadding: { valType: 'integer', - + dflt: 10, editType: 'calc', - + }, labelprefix: { valType: 'string', - + editType: 'calc', - + }, labelsuffix: { valType: 'string', dflt: '', - + editType: 'calc', - + }, // lines and grids showline: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, linecolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'calc', - + }, linewidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc', - + }, gridcolor: { valType: 'color', - + editType: 'calc', - + }, gridwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc', - + }, showgrid: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, minorgridcount: { valType: 'integer', min: 0, dflt: 0, - + editType: 'calc', - + }, minorgridwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc', - + }, minorgridcolor: { valType: 'color', dflt: colorAttrs.lightLine, - + editType: 'calc', - + }, startline: { valType: 'boolean', - + editType: 'calc', - + }, startlinecolor: { valType: 'color', - + editType: 'calc', - + }, startlinewidth: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, endline: { valType: 'boolean', - + editType: 'calc', - + }, endlinewidth: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, endlinecolor: { valType: 'color', - + editType: 'calc', - + }, tick0: { valType: 'number', min: 0, dflt: 0, - + editType: 'calc', - + }, dtick: { valType: 'number', min: 0, dflt: 1, - + editType: 'calc', - + }, arraytick0: { valType: 'integer', min: 0, dflt: 0, - + editType: 'calc', - + }, arraydtick: { valType: 'integer', min: 1, dflt: 1, - + editType: 'calc', - + }, _deprecated: { title: { valType: 'string', - + editType: 'calc', - + }, titlefont: fontAttrs({ editType: 'calc', - + }), titleoffset: { valType: 'number', - + dflt: 10, editType: 'calc', - + } }, @@ -160002,7 +160018,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'carpet', 'carpetAxis', 'notLegendIsolatable', 'noMultiCategory', 'noHover', 'noSortingByValue'], meta: { - + } }; @@ -160967,13 +160983,13 @@ module.exports = extendFlat({ locations: { valType: 'data_array', editType: 'calc', - + }, locationmode: scatterGeoAttrs.locationmode, z: { valType: 'data_array', editType: 'calc', - + }, geojson: extendFlat({}, scatterGeoAttrs.geojson, { @@ -160981,10 +160997,10 @@ module.exports = extendFlat({ featureidkey: scatterGeoAttrs.featureidkey, text: extendFlat({}, scatterGeoAttrs.text, { - + }), hovertext: extendFlat({}, scatterGeoAttrs.hovertext, { - + }), marker: { line: { @@ -160998,9 +161014,9 @@ module.exports = extendFlat({ min: 0, max: 1, dflt: 1, - + editType: 'style', - + }, editType: 'calc' }, @@ -161297,7 +161313,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/geo'), categories: ['geo', 'noOpacity', 'showLegend'], meta: { - + } }; @@ -161515,7 +161531,7 @@ module.exports = extendFlat({ locations: { valType: 'data_array', editType: 'calc', - + }, // TODO @@ -161527,7 +161543,7 @@ module.exports = extendFlat({ z: { valType: 'data_array', editType: 'calc', - + }, // TODO maybe we could also set a "key" to dig out values out of the @@ -161535,9 +161551,9 @@ module.exports = extendFlat({ geojson: { valType: 'any', - + editType: 'calc', - + }, featureidkey: extendFlat({}, choroplethAttrs.featureidkey, { @@ -161552,9 +161568,9 @@ module.exports = extendFlat({ // see https://codepen.io/etpinard/pen/ydVMwM for full list below: { valType: 'string', - + editType: 'plot', - + }, text: choroplethAttrs.text, @@ -161862,7 +161878,7 @@ module.exports = { categories: ['mapbox', 'gl', 'noOpacity', 'showLegend'], meta: { hr_name: 'choropleth_mapbox', - + } }; @@ -162014,37 +162030,37 @@ var extendFlat = _dereq_('../../lib/extend').extendFlat; var attrs = { x: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, y: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, z: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, u: { valType: 'data_array', editType: 'calc', - + }, v: { valType: 'data_array', editType: 'calc', - + }, w: { valType: 'data_array', editType: 'calc', - + }, // TODO add way to specify cone positions independently of the vector field @@ -162071,63 +162087,63 @@ var attrs = { // x: { // valType: 'data_array', // editType: 'calc', - // + // // }, // y: { // valType: 'data_array', // editType: 'calc', - // + // // }, // z: { // valType: 'data_array', // editType: 'calc', - // + // // }, // // editType: 'calc', - // + // // }, sizemode: { valType: 'enumerated', values: ['scaled', 'absolute'], - + editType: 'calc', dflt: 'scaled', - + }, sizeref: { valType: 'number', - + editType: 'calc', min: 0, - + }, anchor: { valType: 'enumerated', - + editType: 'calc', values: ['tip', 'tail', 'cm', 'center'], dflt: 'cm', - + }, text: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, hovertemplate: hovertemplateAttrs({editType: 'calc'}, {keys: ['norm']}), @@ -162440,7 +162456,7 @@ module.exports = { }, meta: { - + } }; @@ -162492,30 +162508,30 @@ module.exports = extendFlat({ fillcolor: { valType: 'color', - + editType: 'calc', - + }, autocontour: { valType: 'boolean', dflt: true, - + editType: 'calc', impliedEdits: { 'contours.start': undefined, 'contours.end': undefined, 'contours.size': undefined }, - + }, ncontours: { valType: 'integer', dflt: 15, min: 1, - + editType: 'calc', - + }, contours: { @@ -162523,83 +162539,83 @@ module.exports = extendFlat({ valType: 'enumerated', values: ['levels', 'constraint'], dflt: 'levels', - + editType: 'calc', - + }, start: { valType: 'number', dflt: null, - + editType: 'plot', impliedEdits: {'^autocontour': false}, - + }, end: { valType: 'number', dflt: null, - + editType: 'plot', impliedEdits: {'^autocontour': false}, - + }, size: { valType: 'number', dflt: null, min: 0, - + editType: 'plot', impliedEdits: {'^autocontour': false}, - + }, coloring: { valType: 'enumerated', values: ['fill', 'heatmap', 'lines', 'none'], dflt: 'fill', - + editType: 'calc', - + }, showlines: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, showlabels: { valType: 'boolean', dflt: false, - + editType: 'plot', - + }, labelfont: fontAttrs({ editType: 'plot', colorEditType: 'style', - + }), labelformat: { valType: 'string', dflt: '', - + editType: 'plot', - + }, operation: { valType: 'enumerated', values: [].concat(COMPARISON_OPS2).concat(INTERVAL_OPS), - + dflt: '=', editType: 'calc', - + }, value: { valType: 'any', dflt: 0, - + editType: 'calc', - + }, editType: 'calc', impliedEdits: {'autocontour': false} @@ -162608,7 +162624,7 @@ module.exports = extendFlat({ line: { color: extendFlat({}, scatterLineAttrs.color, { editType: 'style+colorbars', - + }), width: { valType: 'number', @@ -162619,7 +162635,7 @@ module.exports = extendFlat({ }, dash: dash, smoothing: extendFlat({}, scatterLineAttrs.smoothing, { - + }), editType: 'plot' } @@ -163694,7 +163710,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', '2dMap', 'contour', 'showLegend'], meta: { - + } }; @@ -164847,9 +164863,9 @@ var contourContourAttrs = contourAttrs.contours; module.exports = extendFlat({ carpet: { valType: 'string', - + editType: 'calc', - + }, z: heatmapAttrs.z, a: heatmapAttrs.x, @@ -164879,9 +164895,9 @@ module.exports = extendFlat({ valType: 'enumerated', values: ['fill', 'lines', 'none'], dflt: 'fill', - + editType: 'calc', - + }, showlines: contourContourAttrs.showlines, showlabels: contourContourAttrs.showlabels, @@ -165115,8 +165131,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'carpet', 'contour', 'symbols', 'showLegend', 'hasLines', 'carpetDependent', 'noHover', 'noSortingByValue'], meta: { - - + + } }; @@ -165648,24 +165664,24 @@ module.exports = extendFlat({ z: { valType: 'data_array', editType: 'calc', - + }, radius: { valType: 'number', - + editType: 'plot', arrayOk: true, min: 1, dflt: 30, - + }, below: { valType: 'string', - + editType: 'plot', - + }, text: scatterMapboxAttrs.text, @@ -166029,7 +166045,7 @@ module.exports = { categories: ['mapbox', 'gl', 'showLegend'], meta: { hr_name: 'density_mapbox', - + } }; @@ -166221,10 +166237,10 @@ module.exports = { valType: 'flaglist', flags: ['label', 'text', 'percent initial', 'percent previous', 'percent total', 'value'], extras: ['none'], - + editType: 'plot', arrayOk: false, - + }, // TODO: incorporate `label` and `value` in the eventData texttemplate: texttemplateAttrs({editType: 'plot'}, { @@ -166242,7 +166258,7 @@ module.exports = { cliponaxis: barAttrs.cliponaxis, orientation: extendFlat({}, barAttrs.orientation, { - + }), offset: extendFlat({}, barAttrs.offset, {arrayOk: false}), @@ -166253,9 +166269,9 @@ module.exports = { connector: { fillcolor: { valType: 'color', - + editType: 'style', - + }, line: { color: extendFlat({}, lineAttrs.color, {dflt: Color.defaultLine}), @@ -166269,9 +166285,9 @@ module.exports = { visible: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, editType: 'plot' }, @@ -166692,7 +166708,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['bar-like', 'cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'], meta: { - + } }; @@ -166712,26 +166728,26 @@ module.exports = { valType: 'enumerated', values: ['stack', 'group', 'overlay'], dflt: 'stack', - + editType: 'calc', - + }, funnelgap: { valType: 'number', min: 0, max: 1, - + editType: 'calc', - + }, funnelgroupgap: { valType: 'number', min: 0, max: 1, dflt: 0, - + editType: 'calc', - + } }; @@ -167037,7 +167053,7 @@ module.exports = { line: { color: extendFlat({}, pieAttrs.marker.line.color, { dflt: null, - + }), width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}), editType: 'calc' @@ -167049,7 +167065,7 @@ module.exports = { hovertext: pieAttrs.hovertext, scalegroup: extendFlat({}, pieAttrs.scalegroup, { - + }), textinfo: extendFlat({}, pieAttrs.textinfo, { @@ -167090,21 +167106,21 @@ module.exports = { aspectratio: { valType: 'number', - + min: 0, dflt: 1, editType: 'plot', - + }, baseratio: { valType: 'number', - + min: 0, max: 1, dflt: 0.333, editType: 'plot', - + } }; @@ -167269,7 +167285,7 @@ module.exports = { styleOne: _dereq_('../pie/style_one'), meta: { - + } }; @@ -167291,16 +167307,16 @@ module.exports = { funnelareacolorway: { valType: 'colorlist', - + editType: 'calc', - + }, extendfunnelareacolors: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }; @@ -167681,7 +167697,7 @@ module.exports = extendFlat({ z: { valType: 'data_array', editType: 'calc', - + }, x: extendFlat({}, scatterAttrs.x, {impliedEdits: {xtype: 'array'}}), x0: extendFlat({}, scatterAttrs.x0, {impliedEdits: {xtype: 'scaled'}}), @@ -167693,41 +167709,41 @@ module.exports = extendFlat({ text: { valType: 'data_array', editType: 'calc', - + }, hovertext: { valType: 'data_array', editType: 'calc', - + }, transpose: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, xtype: { valType: 'enumerated', values: ['array', 'scaled'], - + editType: 'calc+clearAxisTypes', - + }, ytype: { valType: 'enumerated', values: ['array', 'scaled'], - + editType: 'calc+clearAxisTypes', - + }, zsmooth: { valType: 'enumerated', values: ['fast', 'best', false], dflt: false, - + editType: 'calc', - + }, hoverongaps: { valType: 'boolean', @@ -167738,32 +167754,32 @@ module.exports = extendFlat({ }, connectgaps: { valType: 'boolean', - + editType: 'calc', - + }, xgap: { valType: 'number', dflt: 0, min: 0, - + editType: 'plot', - + }, ygap: { valType: 'number', dflt: 0, min: 0, - + editType: 'plot', - + }, zhoverformat: { valType: 'string', dflt: '', - + editType: 'none', - + }, hovertemplate: hovertemplateAttrs(), showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) @@ -168455,7 +168471,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', '2dMap', 'showLegend'], meta: { - + } }; @@ -169471,7 +169487,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl2d'), categories: ['gl', 'gl2d', '2dMap'], meta: { - + } }; @@ -169496,64 +169512,64 @@ module.exports = { x: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, y: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, text: extendFlat({}, barAttrs.text, { - + }), hovertext: extendFlat({}, barAttrs.hovertext, { - + }), orientation: barAttrs.orientation, histfunc: { valType: 'enumerated', values: ['count', 'sum', 'avg', 'min', 'max'], - + dflt: 'count', editType: 'calc', - + }, histnorm: { valType: 'enumerated', values: ['', 'percent', 'probability', 'density', 'probability density'], dflt: '', - + editType: 'calc', - + }, cumulative: { enabled: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, direction: { valType: 'enumerated', values: ['increasing', 'decreasing'], dflt: 'increasing', - + editType: 'calc', - + }, currentbin: { valType: 'enumerated', values: ['include', 'exclude', 'half'], dflt: 'include', - + editType: 'calc', - + }, editType: 'calc' }, @@ -169561,9 +169577,9 @@ module.exports = { valType: 'integer', min: 0, dflt: 0, - + editType: 'calc', - + }, xbins: makeBinAttrs('x', true), @@ -169571,32 +169587,32 @@ module.exports = { valType: 'integer', min: 0, dflt: 0, - + editType: 'calc', - + }, ybins: makeBinAttrs('y', true), autobinx: { valType: 'boolean', dflt: null, - + editType: 'calc', - + }, autobiny: { valType: 'boolean', dflt: null, - + editType: 'calc', - + }, bingroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, hovertemplate: hovertemplateAttrs({}, { @@ -169656,21 +169672,21 @@ module.exports = function makeBinAttrs(axLetter, match) { return { start: { valType: 'any', // for date axes - + editType: 'calc', - + }, end: { valType: 'any', // for date axes - + editType: 'calc', - + }, size: { valType: 'any', // for date axes - + editType: 'calc', - + }, editType: 'calc' }; @@ -171001,7 +171017,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['bar-like', 'cartesian', 'svg', 'bar', 'histogram', 'oriented', 'errorBarsOK', 'showLegend'], meta: { - + } }; @@ -171068,13 +171084,13 @@ module.exports = extendFlat( z: { valType: 'data_array', editType: 'calc', - + }, marker: { color: { valType: 'data_array', editType: 'calc', - + }, editType: 'calc' }, @@ -171089,13 +171105,13 @@ module.exports = extendFlat( autobiny: histogramAttrs.autobiny, bingroup: extendFlat({}, histogramAttrs.bingroup, { - + }), xbingroup: extendFlat({}, histogramAttrs.bingroup, { - + }), ybingroup: extendFlat({}, histogramAttrs.bingroup, { - + }), xgap: heatmapAttrs.xgap, @@ -171422,8 +171438,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', '2dMap', 'histogram', 'showLegend'], meta: { - - + + } }; @@ -171594,8 +171610,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'], meta: { - - + + } }; @@ -172215,48 +172231,48 @@ var gaugeBarAttrs = { color: { valType: 'color', editType: 'plot', - - + + }, line: { color: { valType: 'color', - + dflt: colorAttrs.defaultLine, editType: 'plot', - + }, width: { valType: 'number', - + min: 0, dflt: 0, editType: 'plot', - + }, editType: 'calc' }, thickness: { valType: 'number', - + min: 0, max: 1, dflt: 1, editType: 'plot', - + }, editType: 'calc' }; var rangeAttr = { valType: 'info_array', - + items: [ {valType: 'number', editType: 'plot'}, {valType: 'number', editType: 'plot'} ], editType: 'plot', - + }; var stepsAttrs = templatedArray('step', extendDeep({}, gaugeBarAttrs, { @@ -172267,24 +172283,24 @@ module.exports = { mode: { valType: 'flaglist', editType: 'calc', - + flags: ['number', 'delta', 'gauge'], dflt: 'number', - + }, value: { valType: 'number', editType: 'calc', - + anim: true, - + }, align: { valType: 'enumerated', values: ['left', 'center', 'right'], - + editType: 'plot', - + }, // position domain: domainAttrs({name: 'indicator', trace: true, editType: 'calc'}), @@ -172292,19 +172308,19 @@ module.exports = { title: { text: { valType: 'string', - + editType: 'plot', - + }, align: { valType: 'enumerated', values: ['left', 'center', 'right'], - + editType: 'plot', - + }, font: extendFlat({}, textFontAttrs, { - + }), editType: 'plot' }, @@ -172312,71 +172328,71 @@ module.exports = { valueformat: { valType: 'string', dflt: '', - + editType: 'plot', - + }, font: extendFlat({}, textFontAttrs, { - + }), prefix: { valType: 'string', dflt: '', - + editType: 'plot', - + }, suffix: { valType: 'string', dflt: '', - + editType: 'plot', - + }, editType: 'plot' }, delta: { reference: { valType: 'number', - + editType: 'calc', - + }, position: { valType: 'enumerated', values: ['top', 'bottom', 'left', 'right'], - + dflt: 'bottom', editType: 'plot', - + }, relative: { valType: 'boolean', editType: 'plot', - + dflt: false, - + }, valueformat: { valType: 'string', - + editType: 'plot', - + }, increasing: { symbol: { valType: 'string', - + dflt: delta.INCREASING.SYMBOL, editType: 'plot', - + }, color: { valType: 'color', - + dflt: delta.INCREASING.COLOR, editType: 'plot', - + }, // TODO: add attribute to show sign editType: 'plot' @@ -172384,23 +172400,23 @@ module.exports = { decreasing: { symbol: { valType: 'string', - + dflt: delta.DECREASING.SYMBOL, editType: 'plot', - + }, color: { valType: 'color', - + dflt: delta.DECREASING.COLOR, editType: 'plot', - + }, // TODO: add attribute to hide sign editType: 'plot' }, font: extendFlat({}, textFontAttrs, { - + }), editType: 'calc' }, @@ -172408,36 +172424,36 @@ module.exports = { shape: { valType: 'enumerated', editType: 'plot', - + dflt: 'angular', values: ['angular', 'bullet'], - + }, bar: extendDeep({}, gaugeBarAttrs, { color: {dflt: 'green'}, - + }), // Background of the gauge bgcolor: { valType: 'color', - + editType: 'plot', - + }, bordercolor: { valType: 'color', dflt: colorAttrs.defaultLine, - + editType: 'plot', - + }, borderwidth: { valType: 'number', min: 0, dflt: 1, - + editType: 'plot', - + }, axis: overrideAll({ range: rangeAttr, @@ -172457,7 +172473,7 @@ module.exports = { tickcolor: axesAttrs.tickcolor, showticklabels: axesAttrs.showticklabels, tickfont: fontAttrs({ - + }), tickangle: axesAttrs.tickangle, tickformat: axesAttrs.tickformat, @@ -172476,28 +172492,28 @@ module.exports = { threshold: { line: { color: extendFlat({}, gaugeBarAttrs.line.color, { - + }), width: extendFlat({}, gaugeBarAttrs.line.width, { dflt: 1, - + }), editType: 'plot' }, thickness: extendFlat({}, gaugeBarAttrs.thickness, { dflt: 0.85, - + }), value: { valType: 'number', editType: 'calc', dflt: false, - - + + }, editType: 'plot' }, - + editType: 'plot' // TODO: in future version, add marker: (bar|needle) } @@ -172778,7 +172794,7 @@ module.exports = { plot: _dereq_('./plot'), meta: { - + } }; @@ -173686,23 +173702,23 @@ function makeSliceAttr(axLetter) { return { show: { valType: 'boolean', - + dflt: false, - + }, locations: { valType: 'data_array', dflt: [], - - + + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + } }; } @@ -173711,17 +173727,17 @@ function makeCapAttr(axLetter) { return { show: { valType: 'boolean', - + dflt: true, - + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + } }; } @@ -173729,81 +173745,81 @@ function makeCapAttr(axLetter) { var attrs = module.exports = overrideAll(extendFlat({ x: { valType: 'data_array', - - + + }, y: { valType: 'data_array', - - + + }, z: { valType: 'data_array', - - + + }, value: { valType: 'data_array', - - + + }, isomin: { valType: 'number', - - + + }, isomax: { valType: 'number', - - + + }, surface: { show: { valType: 'boolean', - + dflt: true, - + }, count: { valType: 'integer', - + dflt: 2, min: 1, - + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + }, pattern: { valType: 'flaglist', flags: ['A', 'B', 'C', 'D', 'E'], extras: ['all', 'odd', 'even'], dflt: 'all', - - + + } }, spaceframe: { show: { valType: 'boolean', - + dflt: false, - + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 0.15, - + } }, @@ -173821,17 +173837,17 @@ var attrs = module.exports = overrideAll(extendFlat({ text: { valType: 'string', - + dflt: '', arrayOk: true, - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, - + }, hovertemplate: hovertemplateAttrs(), showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false}) @@ -175111,7 +175127,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'showLegend'], meta: { - + } }; @@ -175137,76 +175153,76 @@ module.exports = extendFlat({ x: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, y: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, z: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, i: { valType: 'data_array', editType: 'calc', - + }, j: { valType: 'data_array', editType: 'calc', - + }, k: { valType: 'data_array', editType: 'calc', - + }, text: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, hovertemplate: hovertemplateAttrs({editType: 'calc'}), delaunayaxis: { valType: 'enumerated', - + values: [ 'x', 'y', 'z' ], dflt: 'z', editType: 'calc', - + }, alphahull: { valType: 'number', - + dflt: -1, editType: 'calc', - + }, intensity: { valType: 'data_array', editType: 'calc', - + }, intensitymode: { valType: 'enumerated', @@ -175220,21 +175236,21 @@ module.exports = extendFlat({ // Color field color: { valType: 'color', - + editType: 'calc', - + }, vertexcolor: { valType: 'data_array', - + editType: 'calc', - + }, facecolor: { valType: 'data_array', - + editType: 'calc', - + }, transforms: undefined }, @@ -175249,15 +175265,15 @@ colorScaleAttrs('', { // Flat shaded mode flatshading: { valType: 'boolean', - + dflt: false, editType: 'calc', - + }, contour: { show: extendFlat({}, surfaceAttrs.contours.x.show, { - + }), color: surfaceAttrs.contours.x.color, width: surfaceAttrs.contours.x.width, @@ -175273,21 +175289,21 @@ colorScaleAttrs('', { lighting: extendFlat({ vertexnormalsepsilon: { valType: 'number', - + min: 0.00, max: 1, dflt: 1e-12, // otherwise finely tessellated things eg. the brain will have no specular light reflection editType: 'calc', - + }, facenormalsepsilon: { valType: 'number', - + min: 0.00, max: 1, dflt: 1e-6, // even the brain model doesn't appear to need finer than this editType: 'calc', - + }, editType: 'calc' }, surfaceAttrs.lighting), @@ -175650,7 +175666,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'showLegend'], meta: { - + } }; @@ -175694,39 +175710,39 @@ module.exports = { x: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, open: { valType: 'data_array', editType: 'calc', - + }, high: { valType: 'data_array', editType: 'calc', - + }, low: { valType: 'data_array', editType: 'calc', - + }, close: { valType: 'data_array', editType: 'calc', - + }, line: { width: extendFlat({}, lineAttrs.width, { - + }), dash: extendFlat({}, dash, { - + }), editType: 'style' }, @@ -175737,19 +175753,19 @@ module.exports = { text: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, tickwidth: { @@ -175757,18 +175773,18 @@ module.exports = { min: 0, max: 0.5, dflt: 0.3, - + editType: 'calc', - + }, hoverlabel: extendFlat({}, fxAttrs.hoverlabel, { split: { valType: 'boolean', - + dflt: false, editType: 'style', - + } }), }; @@ -176215,7 +176231,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'showLegend'], meta: { - + }, attributes: _dereq_('./attributes'), @@ -176430,9 +176446,9 @@ var line = extendFlat( valType: 'enumerated', values: ['linear', 'hspline'], dflt: 'linear', - + editType: 'plot', - + }, hovertemplate: hovertemplateAttrs({ @@ -176440,7 +176456,7 @@ var line = extendFlat( arrayOk: false }, { keys: ['count', 'probability'], - + }) } ); @@ -176457,9 +176473,9 @@ module.exports = { valType: 'enumerated', values: ['category', 'color', 'dimension'], dflt: 'category', - + editType: 'plot', - + }, hovertemplate: hovertemplateAttrs({ editType: 'plot', @@ -176469,49 +176485,49 @@ module.exports = { 'count', 'probability', 'category', 'categorycount', 'colorcount', 'bandcolorcount' ], - + }), arrangement: { valType: 'enumerated', values: ['perpendicular', 'freeform', 'fixed'], dflt: 'perpendicular', - + editType: 'plot', - + }, bundlecolors: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, sortpaths: { valType: 'enumerated', values: ['forward', 'backward'], dflt: 'forward', - + editType: 'plot', - + }, labelfont: fontAttrs({ editType: 'calc', - + }), tickfont: fontAttrs({ editType: 'calc', - + }), dimensions: { _isLinkedToArray: 'dimension', label: { valType: 'string', - + editType: 'calc', - + }, categoryorder: { valType: 'enumerated', @@ -176519,43 +176535,43 @@ module.exports = { 'trace', 'category ascending', 'category descending', 'array' ], dflt: 'trace', - + editType: 'calc', - + }, categoryarray: { valType: 'data_array', - + editType: 'calc', - + }, ticktext: { valType: 'data_array', - + editType: 'calc', - + }, values: { valType: 'data_array', - + dflt: [], editType: 'calc', - + }, displayindex: { valType: 'integer', - + editType: 'calc', - + }, editType: 'calc', - + visible: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }, @@ -176565,9 +176581,9 @@ module.exports = { min: 0, dflt: 1, arrayOk: true, - + editType: 'calc', - + }, // Hide unsupported top-level properties from plot-schema @@ -177282,7 +177298,7 @@ module.exports = { basePlotModule: _dereq_('./base_plot'), categories: ['noOpacity'], meta: { - + } }; @@ -179506,49 +179522,49 @@ module.exports = { labelangle: { valType: 'angle', dflt: 0, - + editType: 'plot', - + }, labelside: { valType: 'enumerated', - + values: ['top', 'bottom'], dflt: 'top', editType: 'plot', - + }, labelfont: fontAttrs({ editType: 'plot', - + }), tickfont: fontAttrs({ editType: 'plot', - + }), rangefont: fontAttrs({ editType: 'plot', - + }), dimensions: templatedArray('dimension', { label: { valType: 'string', - + editType: 'plot', - + }, // TODO: better way to determine ordinal vs continuous axes, // so users can use tickvals/ticktext with a continuous axis. tickvals: extendFlat({}, axesAttrs.tickvals, { editType: 'plot', - + }), ticktext: extendFlat({}, axesAttrs.ticktext, { editType: 'plot', - + }), tickformat: extendFlat({}, axesAttrs.tickformat, { editType: 'plot' @@ -179556,23 +179572,23 @@ module.exports = { visible: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, range: { valType: 'info_array', - + items: [ {valType: 'number', editType: 'plot'}, {valType: 'number', editType: 'plot'} ], editType: 'plot', - + }, constraintrange: { valType: 'info_array', - + freeLength: true, dimensions: '1-2', items: [ @@ -179580,23 +179596,23 @@ module.exports = { {valType: 'number', editType: 'plot'} ], editType: 'plot', - + }, multiselect: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, values: { valType: 'data_array', - + editType: 'calc', - + }, editType: 'calc', - + }), line: extendFlat({editType: 'calc'}, @@ -180499,7 +180515,7 @@ module.exports = { basePlotModule: _dereq_('./base_plot'), categories: ['gl', 'regl', 'noOpacity', 'noHover'], meta: { - + } }; @@ -182014,61 +182030,61 @@ var textFontAttrs = fontAttrs({ editType: 'plot', arrayOk: true, colorEditType: 'plot', - + }); module.exports = { labels: { valType: 'data_array', editType: 'calc', - + }, // equivalent of x0 and dx, if label is missing label0: { valType: 'number', - + dflt: 0, editType: 'calc', - + }, dlabel: { valType: 'number', - + dflt: 1, editType: 'calc', - + }, values: { valType: 'data_array', editType: 'calc', - + }, marker: { colors: { valType: 'data_array', // TODO 'color_array' ? editType: 'calc', - + }, line: { color: { valType: 'color', - + dflt: colorAttrs.defaultLine, arrayOk: true, editType: 'style', - + }, width: { valType: 'number', - + min: 0, dflt: 0, arrayOk: true, editType: 'style', - + }, editType: 'calc' }, @@ -182078,15 +182094,15 @@ module.exports = { text: { valType: 'data_array', editType: 'plot', - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'style', - + }, // 'see eg:' @@ -182095,20 +182111,20 @@ module.exports = { // 'of its own. but the point is the size of the whole pie is important.)' scalegroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels) textinfo: { valType: 'flaglist', - + flags: ['label', 'text', 'value', 'percent'], extras: ['none'], editType: 'calc', - + }, hoverinfo: extendFlat({}, baseAttrs.hoverinfo, { flags: ['label', 'text', 'value', 'percent', 'name'] @@ -182121,15 +182137,15 @@ module.exports = { }), textposition: { valType: 'enumerated', - + values: ['inside', 'outside', 'auto', 'none'], dflt: 'auto', arrayOk: true, editType: 'plot', - + }, textfont: extendFlat({}, textFontAttrs, { - + }), insidetextorientation: { valType: 'enumerated', @@ -182140,10 +182156,10 @@ module.exports = { }, insidetextfont: extendFlat({}, textFontAttrs, { - + }), outsidetextfont: extendFlat({}, textFontAttrs, { - + }), automargin: { valType: 'boolean', @@ -182157,12 +182173,12 @@ module.exports = { text: { valType: 'string', dflt: '', - + editType: 'plot', - + }, font: extendFlat({}, textFontAttrs, { - + }), position: { valType: 'enumerated', @@ -182171,9 +182187,9 @@ module.exports = { 'middle center', 'bottom left', 'bottom center', 'bottom right' ], - + editType: 'plot', - + }, editType: 'plot' @@ -182184,21 +182200,21 @@ module.exports = { hole: { valType: 'number', - + min: 0, max: 1, dflt: 0, editType: 'calc', - + }, // ordering and direction sort: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, direction: { /** @@ -182210,42 +182226,42 @@ module.exports = { */ valType: 'enumerated', values: ['clockwise', 'counterclockwise'], - + dflt: 'counterclockwise', editType: 'calc', - + }, rotation: { valType: 'number', - + min: -360, max: 360, dflt: 0, editType: 'calc', - + }, pull: { valType: 'number', - + min: 0, max: 1, dflt: 0, arrayOk: true, editType: 'calc', - + }, _deprecated: { title: { valType: 'string', dflt: '', - + editType: 'calc', - + }, titlefont: extendFlat({}, textFontAttrs, { - + }), titleposition: { valType: 'enumerated', @@ -182254,9 +182270,9 @@ module.exports = { 'middle center', 'bottom left', 'bottom center', 'bottom right' ], - + editType: 'calc', - + } } }; @@ -182718,7 +182734,7 @@ module.exports = { basePlotModule: _dereq_('./base_plot'), categories: ['pie-like', 'pie', 'showLegend'], meta: { - + } }; @@ -182736,22 +182752,22 @@ module.exports = { module.exports = { hiddenlabels: { valType: 'data_array', - + editType: 'calc', - + }, piecolorway: { valType: 'colorlist', - + editType: 'calc', - + }, extendpiecolors: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }; @@ -184034,31 +184050,31 @@ module.exports = { xy: { valType: 'data_array', editType: 'calc', - + }, indices: { valType: 'data_array', editType: 'calc', - + }, xbounds: { valType: 'data_array', editType: 'calc', - + }, ybounds: { valType: 'data_array', editType: 'calc', - + }, text: scatterglAttrs.text, marker: { color: { valType: 'color', arrayOk: false, - + editType: 'calc', - + }, opacity: { valType: 'number', @@ -184066,50 +184082,50 @@ module.exports = { max: 1, dflt: 1, arrayOk: false, - + editType: 'calc', - + }, blend: { valType: 'boolean', dflt: null, - + editType: 'calc', - + }, sizemin: { valType: 'number', min: 0.1, max: 2, dflt: 0.5, - + editType: 'calc', - + }, sizemax: { valType: 'number', min: 0.1, dflt: 20, - + editType: 'calc', - + }, border: { color: { valType: 'color', arrayOk: false, - + editType: 'calc', - + }, arearatio: { valType: 'number', min: 0, max: 1, dflt: 0, - + editType: 'calc', - + }, editType: 'calc' }, @@ -184392,7 +184408,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl2d'), categories: ['gl', 'gl2d', 'showLegend'], meta: { - + } }; @@ -184425,7 +184441,7 @@ var attrs = module.exports = overrideAll({ hoverinfo: extendFlat({}, baseAttrs.hoverinfo, { flags: [], arrayOk: false, - + }), hoverlabel: fxAttrs.hoverlabel, domain: domainAttrs({name: 'sankey', trace: true}), @@ -184434,34 +184450,34 @@ var attrs = module.exports = overrideAll({ valType: 'enumerated', values: ['v', 'h'], dflt: 'h', - - + + }, valueformat: { valType: 'string', dflt: '.3s', - - + + }, valuesuffix: { valType: 'string', dflt: '', - - + + }, arrangement: { valType: 'enumerated', values: ['snap', 'perpendicular', 'freeform', 'fixed'], dflt: 'snap', - - + + }, textfont: fontAttrs({ - + }), // Remove top-level customdata @@ -184471,8 +184487,8 @@ var attrs = module.exports = overrideAll({ label: { valType: 'data_array', dflt: [], - - + + }, groups: { valType: 'info_array', @@ -184481,26 +184497,26 @@ var attrs = module.exports = overrideAll({ freeLength: true, dflt: [], items: {valType: 'number', editType: 'calc'}, - - + + }, x: { valType: 'data_array', dflt: [], - - + + }, y: { valType: 'data_array', dflt: [], - - + + }, color: { valType: 'color', - + arrayOk: true, - + }, customdata: { valType: 'data_array', @@ -184510,18 +184526,18 @@ var attrs = module.exports = overrideAll({ line: { color: { valType: 'color', - + dflt: colorAttrs.defaultLine, arrayOk: true, - + }, width: { valType: 'number', - + min: 0, dflt: 0.5, arrayOk: true, - + } }, pad: { @@ -184529,27 +184545,27 @@ var attrs = module.exports = overrideAll({ arrayOk: false, min: 0, dflt: 20, - - + + }, thickness: { valType: 'number', arrayOk: false, min: 1, dflt: 20, - - + + }, hoverinfo: { valType: 'enumerated', values: ['all', 'none', 'skip'], dflt: 'all', - - + + }, hoverlabel: fxAttrs.hoverlabel, // needs editType override, hovertemplate: hovertemplateAttrs({}, { - + keys: ['value', 'label'] }), moreInfo: { @@ -184563,14 +184579,14 @@ var attrs = module.exports = overrideAll({ label: { valType: 'data_array', dflt: [], - - + + }, color: { valType: 'color', - + arrayOk: true, - + }, customdata: { valType: 'data_array', @@ -184580,37 +184596,37 @@ var attrs = module.exports = overrideAll({ line: { color: { valType: 'color', - + dflt: colorAttrs.defaultLine, arrayOk: true, - + }, width: { valType: 'number', - + min: 0, dflt: 0, arrayOk: true, - + } }, source: { valType: 'data_array', - + dflt: [], - + }, target: { valType: 'data_array', - + dflt: [], - + }, value: { valType: 'data_array', dflt: [], - - + + }, moreInfo: { valType: 'data_array', @@ -184620,41 +184636,41 @@ var attrs = module.exports = overrideAll({ valType: 'enumerated', values: ['all', 'none', 'skip'], dflt: 'all', - - + + }, hoverlabel: fxAttrs.hoverlabel, // needs editType override, hovertemplate: hovertemplateAttrs({}, { - + keys: ['value', 'label'] }), colorscales: templatedArray('concentrationscales', { editType: 'calc', label: { valType: 'string', - + editType: 'calc', - + dflt: '' }, cmax: { valType: 'number', - + editType: 'calc', dflt: 1, - + }, cmin: { valType: 'number', - + editType: 'calc', dflt: 0, - + }, colorscale: extendFlat(colorAttributes().colorscale, {dflt: [[0, 'white'], [1, 'black']]}) }), - - + + } }, 'calc', 'nested'); attrs.transforms = undefined; @@ -185161,7 +185177,7 @@ module.exports = { selectPoints: _dereq_('./select.js'), categories: ['noOpacity'], meta: { - + } }; @@ -186770,85 +186786,85 @@ module.exports = { valType: 'data_array', editType: 'calc+clearAxisTypes', anim: true, - + }, x0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', anim: true, - + }, dx: { valType: 'number', dflt: 1, - + editType: 'calc', anim: true, - + }, y: { valType: 'data_array', editType: 'calc+clearAxisTypes', anim: true, - + }, y0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', anim: true, - + }, dy: { valType: 'number', dflt: 1, - + editType: 'calc', anim: true, - + }, stackgroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, orientation: { valType: 'enumerated', - + values: ['v', 'h'], editType: 'calc', - + }, groupnorm: { valType: 'enumerated', values: ['', 'fraction', 'percent'], dflt: '', - + editType: 'calc', - + }, stackgaps: { valType: 'enumerated', values: ['infer zero', 'interpolate'], dflt: 'infer zero', - + editType: 'calc', - + }, text: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'calc', - + }, texttemplate: texttemplateAttrs({}, { @@ -186856,26 +186872,26 @@ module.exports = { }), hovertext: { valType: 'string', - + dflt: '', arrayOk: true, editType: 'style', - + }, mode: { valType: 'flaglist', flags: ['lines', 'markers', 'text'], extras: ['none'], - + editType: 'calc', - + }, hoveron: { valType: 'flaglist', flags: ['points', 'fills'], - + editType: 'style', - + }, hovertemplate: hovertemplateAttrs({}, { keys: constants.eventDataKeys @@ -186883,44 +186899,44 @@ module.exports = { line: { color: { valType: 'color', - + editType: 'style', anim: true, - + }, width: { valType: 'number', min: 0, dflt: 2, - + editType: 'style', anim: true, - + }, shape: { valType: 'enumerated', values: ['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv'], dflt: 'linear', - + editType: 'plot', - + }, smoothing: { valType: 'number', min: 0, max: 1.3, dflt: 1, - + editType: 'plot', - + }, dash: extendFlat({}, dash, {editType: 'style'}), simplify: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, editType: 'plot' }, @@ -186928,31 +186944,31 @@ module.exports = { connectgaps: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, cliponaxis: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, fill: { valType: 'enumerated', values: ['none', 'tozeroy', 'tozerox', 'tonexty', 'tonextx', 'toself', 'tonext'], - + editType: 'calc', - + }, fillcolor: { valType: 'color', - + editType: 'style', anim: true, - + }, marker: extendFlat({ symbol: { @@ -186960,60 +186976,60 @@ module.exports = { values: Drawing.symbolList, dflt: 'circle', arrayOk: true, - + editType: 'style', - + }, opacity: { valType: 'number', min: 0, max: 1, arrayOk: true, - + editType: 'style', anim: true, - + }, size: { valType: 'number', min: 0, dflt: 6, arrayOk: true, - + editType: 'calc', anim: true, - + }, maxdisplayed: { valType: 'number', min: 0, dflt: 0, - + editType: 'plot', - + }, sizeref: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, sizemin: { valType: 'number', min: 0, dflt: 0, - + editType: 'calc', - + }, sizemode: { valType: 'enumerated', values: ['diameter', 'area'], dflt: 'diameter', - + editType: 'calc', - + }, line: extendFlat({ @@ -187021,10 +187037,10 @@ module.exports = { valType: 'number', min: 0, arrayOk: true, - + editType: 'style', anim: true, - + }, editType: 'calc' }, @@ -187036,16 +187052,16 @@ module.exports = { values: ['radial', 'horizontal', 'vertical', 'none'], arrayOk: true, dflt: 'none', - + editType: 'calc', - + }, color: { valType: 'color', arrayOk: true, - + editType: 'calc', - + }, editType: 'calc' }, @@ -187059,31 +187075,31 @@ module.exports = { valType: 'number', min: 0, max: 1, - + editType: 'style', - + }, color: { valType: 'color', - + editType: 'style', - + }, size: { valType: 'number', min: 0, - + editType: 'style', - + }, editType: 'style' }, textfont: { color: { valType: 'color', - + editType: 'style', - + }, editType: 'style' }, @@ -187095,31 +187111,31 @@ module.exports = { valType: 'number', min: 0, max: 1, - + editType: 'style', - + }, color: { valType: 'color', - + editType: 'style', - + }, size: { valType: 'number', min: 0, - + editType: 'style', - + }, editType: 'style' }, textfont: { color: { valType: 'color', - + editType: 'style', - + }, editType: 'style' }, @@ -187135,26 +187151,26 @@ module.exports = { ], dflt: 'middle center', arrayOk: true, - + editType: 'calc', - + }, textfont: fontAttrs({ editType: 'calc', colorEditType: 'style', arrayOk: true, - + }), r: { valType: 'data_array', editType: 'calc', - + }, t: { valType: 'data_array', editType: 'calc', - + } }; @@ -188193,7 +188209,7 @@ module.exports = { 'zoomScale' ], meta: { - + } }; @@ -189875,8 +189891,8 @@ var lineAttrs = extendFlat({ valType: 'enumerated', values: Object.keys(DASHES), dflt: 'solid', - - + + } }, colorAttributes('line')); @@ -189884,25 +189900,25 @@ function makeProjectionAttr(axLetter) { return { show: { valType: 'boolean', - + dflt: false, - + }, opacity: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + }, scale: { valType: 'number', - + min: 0, max: 10, dflt: 2 / 3, - + } }; } @@ -189912,17 +189928,17 @@ var attrs = module.exports = overrideAll({ y: scatterAttrs.y, z: { valType: 'data_array', - + }, text: extendFlat({}, scatterAttrs.text, { - + }), texttemplate: texttemplateAttrs({}, { }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), hovertemplate: hovertemplateAttrs(), @@ -189930,15 +189946,15 @@ var attrs = module.exports = overrideAll({ {dflt: 'lines+markers'}), surfaceaxis: { valType: 'enumerated', - + values: [-1, 0, 1, 2], dflt: -1, - + }, surfacecolor: { valType: 'color', - - + + }, projection: { x: makeProjectionAttr('x'), @@ -189953,10 +189969,10 @@ var attrs = module.exports = overrideAll({ symbol: { valType: 'enumerated', values: Object.keys(MARKER_SYMBOLS), - + dflt: 'circle', arrayOk: true, - + }, size: extendFlat({}, scatterMarkerAttrs.size, {dflt: 8}), sizeref: scatterMarkerAttrs.sizeref, @@ -189964,7 +189980,7 @@ var attrs = module.exports = overrideAll({ sizemode: scatterMarkerAttrs.sizemode, opacity: extendFlat({}, scatterMarkerAttrs.opacity, { arrayOk: false, - + }), colorbar: scatterMarkerAttrs.colorbar, @@ -190769,8 +190785,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -190800,29 +190816,29 @@ var scatterMarkerLineAttrs = scatterMarkerAttrs.line; module.exports = { carpet: { valType: 'string', - + editType: 'calc', - + }, a: { valType: 'data_array', editType: 'calc', - + }, b: { valType: 'data_array', editType: 'calc', - + }, mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}), text: extendFlat({}, scatterAttrs.text, { - + }), texttemplate: texttemplateAttrs({editType: 'plot'}, { keys: ['a', 'b', 'text'] }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), line: { color: scatterLineAttrs.color, @@ -190837,7 +190853,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, marker: extendFlat({ @@ -191190,8 +191206,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['svg', 'carpet', 'symbols', 'showLegend', 'carpetDependent', 'zoomScale'], meta: { - - + + } }; @@ -191267,23 +191283,23 @@ var scatterMarkerLineAttrs = scatterMarkerAttrs.line; module.exports = overrideAll({ lon: { valType: 'data_array', - + }, lat: { valType: 'data_array', - + }, locations: { valType: 'data_array', - + }, locationmode: { valType: 'enumerated', values: ['ISO-3', 'USA-states', 'country names', 'geojson-id'], - + dflt: 'ISO-3', - + }, geojson: { @@ -191303,13 +191319,13 @@ module.exports = overrideAll({ mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}), text: extendFlat({}, scatterAttrs.text, { - + }), texttemplate: texttemplateAttrs({editType: 'plot'}, { keys: ['lat', 'lon', 'location', 'text'] }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), textfont: scatterAttrs.textfont, @@ -191344,8 +191360,8 @@ module.exports = overrideAll({ valType: 'enumerated', values: ['none', 'toself'], dflt: 'none', - - + + }, fillcolor: scatterAttrs.fillcolor, @@ -191703,8 +191719,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/geo'), categories: ['geo', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -191984,8 +192000,8 @@ var attrs = module.exports = overrideAll({ valType: 'flaglist', flags: ['lines', 'markers', 'text'], extras: ['none'], - - + + }, line: { color: scatterLineAttrs.color, @@ -191994,16 +192010,16 @@ var attrs = module.exports = overrideAll({ valType: 'enumerated', values: ['linear', 'hv', 'vh', 'hvh', 'vhv'], dflt: 'linear', - + editType: 'plot', - + }, dash: { valType: 'enumerated', values: Object.keys(DASHES), dflt: 'solid', - - + + } }, marker: extendFlat({}, colorScaleAttrs('marker'), { @@ -193306,8 +193322,8 @@ module.exports = { selectPoints: _dereq_('./select'), meta: { - - + + } }; @@ -193951,17 +193967,17 @@ module.exports = overrideAll({ mode: extendFlat({}, scatterAttrs.mode, { dflt: 'markers', - + }), text: extendFlat({}, scatterAttrs.text, { - + }), texttemplate: texttemplateAttrs({editType: 'plot'}, { keys: ['lat', 'lon', 'text'] }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), line: { @@ -193978,9 +193994,9 @@ module.exports = overrideAll({ symbol: { valType: 'string', dflt: 'circle', - + arrayOk: true, - + }, angle: { valType: 'number', @@ -194013,8 +194029,8 @@ module.exports = overrideAll({ below: { valType: 'string', - - + + }, selected: { @@ -194635,8 +194651,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/mapbox'), categories: ['mapbox', 'gl', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -194852,51 +194868,51 @@ module.exports = { r: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, theta: { valType: 'data_array', editType: 'calc+clearAxisTypes', - + }, r0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', - + }, dr: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, theta0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', - + }, dtheta: { valType: 'number', - + editType: 'calc', - + }, thetaunit: { valType: 'enumerated', values: ['radians', 'degrees', 'gradians'], dflt: 'degrees', - + editType: 'calc+clearAxisTypes', - + }, text: scatterAttrs.text, @@ -194926,7 +194942,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, @@ -195254,8 +195270,8 @@ module.exports = { selectPoints: _dereq_('../scatter/select'), meta: { - - + + } }; @@ -195572,8 +195588,8 @@ module.exports = { selectPoints: _dereq_('../scattergl/select'), meta: { - - + + } }; @@ -195743,35 +195759,35 @@ module.exports = { a: { valType: 'data_array', editType: 'calc', - + }, b: { valType: 'data_array', editType: 'calc', - + }, c: { valType: 'data_array', editType: 'calc', - + }, sum: { valType: 'number', - + dflt: 0, min: 0, editType: 'calc', - + }, mode: extendFlat({}, scatterAttrs.mode, {dflt: 'markers'}), text: extendFlat({}, scatterAttrs.text, { - + }), texttemplate: texttemplateAttrs({editType: 'plot'}, { keys: ['a', 'b', 'c', 'text'] }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), line: { color: scatterLineAttrs.color, @@ -195787,7 +195803,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, marker: extendFlat({ @@ -196167,8 +196183,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/ternary'), categories: ['ternary', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -196250,14 +196266,14 @@ function makeAxesValObject(axLetter) { return { valType: 'info_array', freeLength: true, - + editType: 'calc', items: { valType: 'subplotid', regex: cartesianIdRegex[axLetter], editType: 'plot' }, - + }; } @@ -196265,40 +196281,40 @@ module.exports = { dimensions: templatedArray('dimension', { visible: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, label: { valType: 'string', - + editType: 'calc', - + }, values: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, axis: { type: { valType: 'enumerated', values: ['linear', 'log', 'date', 'category'], - + editType: 'calc+clearAxisTypes', - + }, // TODO make 'true' the default in v2? matches: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, editType: 'calc+clearAxisTypes' @@ -196316,10 +196332,10 @@ module.exports = { // mode: {}, (only 'markers' for now) text: extendFlat({}, scatterGlAttrs.text, { - + }), hovertext: extendFlat({}, scatterGlAttrs.hovertext, { - + }), hovertemplate: hovertemplateAttrs(), @@ -196332,10 +196348,10 @@ module.exports = { diagonal: { visible: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, // type: 'scattergl' | 'histogram' | 'box' | 'violin' @@ -196347,17 +196363,17 @@ module.exports = { showupperhalf: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, showlowerhalf: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, selected: { @@ -197028,7 +197044,7 @@ module.exports = { editStyle: _dereq_('./edit_style'), meta: { - + } }; @@ -197349,54 +197365,54 @@ var extendFlat = _dereq_('../../lib/extend').extendFlat; var attrs = { x: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, y: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, z: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, u: { valType: 'data_array', editType: 'calc', - + }, v: { valType: 'data_array', editType: 'calc', - + }, w: { valType: 'data_array', editType: 'calc', - + }, starts: { x: { valType: 'data_array', editType: 'calc', - + }, y: { valType: 'data_array', editType: 'calc', - + }, z: { valType: 'data_array', editType: 'calc', - + }, editType: 'calc' }, @@ -197405,9 +197421,9 @@ var attrs = { valType: 'integer', min: 0, dflt: 1000, - + editType: 'calc', - + }, // TODO @@ -197422,33 +197438,33 @@ var attrs = { // valType: 'enumerated', // values: ['scaled', 'absolute', 'fixed'], // dflt: 'scaled', - // + // // editType: 'calc', - // + // // }, sizeref: { valType: 'number', - + editType: 'calc', min: 0, dflt: 1, - + }, text: { valType: 'string', - + dflt: '', editType: 'calc', - + }, hovertext: { valType: 'string', - + dflt: '', editType: 'calc', - + }, hovertemplate: hovertemplateAttrs({editType: 'calc'}, { keys: [ @@ -198074,7 +198090,7 @@ module.exports = { }, meta: { - + } }; @@ -198103,18 +198119,18 @@ module.exports = { labels: { valType: 'data_array', editType: 'calc', - + }, parents: { valType: 'data_array', editType: 'calc', - + }, values: { valType: 'data_array', editType: 'calc', - + }, branchvalues: { valType: 'enumerated', @@ -198133,29 +198149,29 @@ module.exports = { dflt: 'leaves', editType: 'calc', - + }, level: { valType: 'any', editType: 'plot', anim: true, - - + + }, maxdepth: { valType: 'integer', editType: 'plot', - + dflt: -1, - + }, marker: extendFlat({ colors: { valType: 'data_array', editType: 'calc', - + }, // colorinheritance: { @@ -198166,7 +198182,7 @@ module.exports = { line: { color: extendFlat({}, pieAttrs.marker.line.color, { dflt: null, - + }), width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}), editType: 'calc' @@ -198183,10 +198199,10 @@ module.exports = { opacity: { valType: 'number', editType: 'style', - + min: 0, max: 1, - + }, editType: 'plot' }, @@ -199219,7 +199235,7 @@ module.exports = { colorbar: _dereq_('../scatter/marker_colorbar'), meta: { - + } }; @@ -199237,16 +199253,16 @@ module.exports = { module.exports = { sunburstcolorway: { valType: 'colorlist', - + editType: 'calc', - + }, extendsunburstcolors: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }; @@ -199976,9 +199992,9 @@ var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; function makeContourProjAttr(axLetter) { return { valType: 'boolean', - + dflt: false, - + }; } @@ -199986,34 +200002,34 @@ function makeContourAttr(axLetter) { return { show: { valType: 'boolean', - + dflt: false, - + }, start: { valType: 'number', dflt: null, - + editType: 'plot', // impliedEdits: {'^autocontour': false}, - + }, end: { valType: 'number', dflt: null, - + editType: 'plot', // impliedEdits: {'^autocontour': false}, - + }, size: { valType: 'number', dflt: null, min: 0, - + editType: 'plot', // impliedEdits: {'^autocontour': false}, - + }, project: { x: makeContourProjAttr('x'), @@ -200022,43 +200038,43 @@ function makeContourAttr(axLetter) { }, color: { valType: 'color', - + dflt: Color.defaultLine, - + }, usecolormap: { valType: 'boolean', - + dflt: false, - + }, width: { valType: 'number', - + min: 1, max: 16, dflt: 2, - + }, highlight: { valType: 'boolean', - + dflt: true, - + }, highlightcolor: { valType: 'color', - + dflt: Color.defaultLine, - + }, highlightwidth: { valType: 'number', - + min: 1, max: 16, dflt: 2, - + } }; } @@ -200066,44 +200082,44 @@ function makeContourAttr(axLetter) { var attrs = module.exports = overrideAll(extendFlat({ z: { valType: 'data_array', - + }, x: { valType: 'data_array', - + }, y: { valType: 'data_array', - + }, text: { valType: 'string', - + dflt: '', arrayOk: true, - + }, hovertext: { valType: 'string', - + dflt: '', arrayOk: true, - + }, hovertemplate: hovertemplateAttrs(), connectgaps: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, surfacecolor: { valType: 'data_array', - + }, }, @@ -200120,88 +200136,88 @@ colorScaleAttrs('', { }, hidesurface: { valType: 'boolean', - + dflt: false, - + }, lightposition: { x: { valType: 'number', - + min: -1e5, max: 1e5, dflt: 10, - + }, y: { valType: 'number', - + min: -1e5, max: 1e5, dflt: 1e4, - + }, z: { valType: 'number', - + min: -1e5, max: 1e5, dflt: 0, - + } }, lighting: { ambient: { valType: 'number', - + min: 0.00, max: 1.0, dflt: 0.8, - + }, diffuse: { valType: 'number', - + min: 0.00, max: 1.00, dflt: 0.8, - + }, specular: { valType: 'number', - + min: 0.00, max: 2.00, dflt: 0.05, - + }, roughness: { valType: 'number', - + min: 0.00, max: 1.00, dflt: 0.5, - + }, fresnel: { valType: 'number', - + min: 0.00, max: 5.00, dflt: 0.2, - + } }, opacity: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + }, opacityscale: { @@ -200213,13 +200229,13 @@ colorScaleAttrs('', { _deprecated: { zauto: extendFlat({}, colorScaleAttrs.zauto, { - + }), zmin: extendFlat({}, colorScaleAttrs.zmin, { - + }), zmax: extendFlat({}, colorScaleAttrs.zmax, { - + }) }, @@ -201167,7 +201183,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', '2dMap', 'showLegend'], meta: { - + } }; @@ -201197,53 +201213,53 @@ var attrs = module.exports = overrideAll({ valType: 'number', arrayOk: true, dflt: null, - - + + }, columnorder: { valType: 'data_array', - - + + }, header: { values: { valType: 'data_array', - + dflt: [], - + }, format: { valType: 'data_array', - + dflt: [], - + }, prefix: { valType: 'string', arrayOk: true, dflt: null, - - + + }, suffix: { valType: 'string', arrayOk: true, dflt: null, - - + + }, height: { valType: 'number', dflt: 28, - - + + }, align: extendFlat({}, annAttrs.align, {arrayOk: true}), @@ -201253,13 +201269,13 @@ var attrs = module.exports = overrideAll({ valType: 'number', arrayOk: true, dflt: 1, - + }, color: { valType: 'color', arrayOk: true, dflt: 'grey', - + } }, @@ -201268,8 +201284,8 @@ var attrs = module.exports = overrideAll({ valType: 'color', arrayOk: true, dflt: 'white', - - + + } }, @@ -201280,39 +201296,39 @@ var attrs = module.exports = overrideAll({ values: { valType: 'data_array', - + dflt: [], - + }, format: { valType: 'data_array', - + dflt: [], - + }, prefix: { valType: 'string', arrayOk: true, dflt: null, - - + + }, suffix: { valType: 'string', arrayOk: true, dflt: null, - - + + }, height: { valType: 'number', dflt: 20, - - + + }, align: extendFlat({}, annAttrs.align, {arrayOk: true}), @@ -201322,13 +201338,13 @@ var attrs = module.exports = overrideAll({ valType: 'number', arrayOk: true, dflt: 1, - + }, color: { valType: 'color', arrayOk: true, dflt: 'grey', - + } }, @@ -201336,9 +201352,9 @@ var attrs = module.exports = overrideAll({ color: { valType: 'color', arrayOk: true, - + dflt: 'white', - + } }, @@ -201823,7 +201839,7 @@ module.exports = { basePlotModule: _dereq_('./base_plot'), categories: ['noOpacity'], meta: { - + } }; @@ -204473,43 +204489,43 @@ module.exports = { x0: boxAttrs.x0, y0: boxAttrs.y0, name: extendFlat({}, boxAttrs.name, { - + }), orientation: extendFlat({}, boxAttrs.orientation, { - + }), bandwidth: { valType: 'number', min: 0, - + editType: 'calc', - + }, scalegroup: { valType: 'string', - + dflt: '', editType: 'calc', - + }, scalemode: { valType: 'enumerated', values: ['width', 'count'], dflt: 'width', - + editType: 'calc', - + }, spanmode: { valType: 'enumerated', values: ['soft', 'hard', 'manual'], dflt: 'soft', - + editType: 'calc', - + }, span: { valType: 'info_array', @@ -204517,42 +204533,42 @@ module.exports = { {valType: 'any', editType: 'calc'}, {valType: 'any', editType: 'calc'} ], - + editType: 'calc', - + }, line: { color: { valType: 'color', - + editType: 'style', - + }, width: { valType: 'number', - + min: 0, dflt: 2, editType: 'style', - + }, editType: 'plot' }, fillcolor: boxAttrs.fillcolor, points: extendFlat({}, boxAttrs.boxpoints, { - + }), jitter: extendFlat({}, boxAttrs.jitter, { - + }), pointpos: extendFlat({}, boxAttrs.pointpos, { - + }), width: extendFlat({}, boxAttrs.width, { - + }), marker: boxAttrs.marker, @@ -204564,38 +204580,38 @@ module.exports = { visible: { valType: 'boolean', dflt: false, - + editType: 'plot', - + }, width: { valType: 'number', min: 0, max: 1, dflt: 0.25, - + editType: 'plot', - + }, fillcolor: { valType: 'color', - + editType: 'style', - + }, line: { color: { valType: 'color', - + editType: 'style', - + }, width: { valType: 'number', min: 0, - + editType: 'style', - + }, editType: 'style' }, @@ -204606,22 +204622,22 @@ module.exports = { visible: { valType: 'boolean', dflt: false, - + editType: 'plot', - + }, color: { valType: 'color', - + editType: 'style', - + }, width: { valType: 'number', min: 0, - + editType: 'style', - + }, editType: 'plot' }, @@ -204630,9 +204646,9 @@ module.exports = { valType: 'enumerated', values: ['both', 'positive', 'negative'], dflt: 'both', - + editType: 'calc', - + }, offsetgroup: boxAttrs.offsetgroup, @@ -204646,9 +204662,9 @@ module.exports = { flags: ['violins', 'points', 'kde'], dflt: 'violins+points+kde', extras: ['all'], - + editType: 'style', - + } }; @@ -205147,7 +205163,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'violinLayout', 'zoomScale'], meta: { - + } }; @@ -205167,13 +205183,13 @@ var extendFlat = _dereq_('../../lib').extendFlat; module.exports = { violinmode: extendFlat({}, boxLayoutAttrs.boxmode, { - + }), violingap: extendFlat({}, boxLayoutAttrs.boxgap, { - + }), violingroupgap: extendFlat({}, boxLayoutAttrs.boxgroupgap, { - + }) }; @@ -205474,17 +205490,17 @@ var attrs = module.exports = overrideAll(extendFlat({ spaceframe: { show: { valType: 'boolean', - + dflt: false, - + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + } }, @@ -205702,7 +205718,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'showLegend'], meta: { - + } }; @@ -205732,18 +205748,18 @@ function directionAttrs(dirTxt) { color: extendFlat({}, barAttrs.marker.color, { arrayOk: false, editType: 'style', - + }), line: { color: extendFlat({}, barAttrs.marker.line.color, { arrayOk: false, editType: 'style', - + }), width: extendFlat({}, barAttrs.marker.line.width, { arrayOk: false, editType: 'style', - + }), editType: 'style', }, @@ -205757,18 +205773,18 @@ module.exports = { measure: { valType: 'data_array', dflt: [], - + editType: 'calc', - + }, base: { valType: 'number', dflt: null, arrayOk: false, - + editType: 'calc', - + }, x: barAttrs.x, @@ -205791,10 +205807,10 @@ module.exports = { valType: 'flaglist', flags: ['label', 'text', 'initial', 'delta', 'final'], extras: ['none'], - + editType: 'plot', arrayOk: false, - + }, // TODO: incorporate `label` and `value` in the eventData texttemplate: texttemplateAttrs({editType: 'plot'}, { @@ -205832,16 +205848,16 @@ module.exports = { valType: 'enumerated', values: ['spanning', 'between'], dflt: 'between', - + editType: 'plot', - + }, visible: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, editType: 'plot' }, @@ -206305,7 +206321,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['bar-like', 'cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'], meta: { - + } }; @@ -206325,26 +206341,26 @@ module.exports = { valType: 'enumerated', values: ['group', 'overlay'], dflt: 'group', - + editType: 'calc', - + }, waterfallgap: { valType: 'number', min: 0, max: 1, - + editType: 'calc', - + }, waterfallgroupgap: { valType: 'number', min: 0, max: 1, dflt: 0, - + editType: 'calc', - + } }; @@ -206602,9 +206618,9 @@ var attrs = exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, groups: { // TODO: groupby should support string or array grouping this way too @@ -206614,40 +206630,40 @@ var attrs = exports.attributes = { noBlank: true, arrayOk: true, dflt: 'x', - + editType: 'calc', - + }, aggregations: { _isLinkedToArray: 'aggregation', target: { valType: 'string', - + editType: 'calc', - + }, func: { valType: 'enumerated', values: ['count', 'sum', 'avg', 'median', 'mode', 'rms', 'stddev', 'min', 'max', 'first', 'last', 'change', 'range'], dflt: 'first', - + editType: 'calc', - + }, funcmode: { valType: 'enumerated', values: ['sample', 'population'], dflt: 'sample', - + editType: 'calc', - + }, enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, editType: 'calc' }, @@ -207030,9 +207046,9 @@ exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, target: { valType: 'string', @@ -207040,9 +207056,9 @@ exports.attributes = { noBlank: true, arrayOk: true, dflt: 'x', - + editType: 'calc', - + }, operation: { valType: 'enumerated', @@ -207051,23 +207067,23 @@ exports.attributes = { .concat(INTERVAL_OPS) .concat(SET_OPS), dflt: '=', - + editType: 'calc', - + }, value: { valType: 'any', dflt: 0, - + editType: 'calc', - + }, preservegaps: { valType: 'boolean', dflt: false, - + editType: 'calc', - + }, editType: 'calc' }; @@ -207303,37 +207319,37 @@ exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, groups: { valType: 'data_array', dflt: [], - + editType: 'calc', - + }, nameformat: { valType: 'string', - + editType: 'calc', - + }, styles: { _isLinkedToArray: 'style', target: { valType: 'string', - + editType: 'calc', - + }, value: { valType: 'any', - + dflt: {}, editType: 'calc', - + _compareAsJSON: true }, editType: 'calc' @@ -207592,9 +207608,9 @@ exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, target: { valType: 'string', @@ -207602,17 +207618,17 @@ exports.attributes = { noBlank: true, arrayOk: true, dflt: 'x', - + editType: 'calc', - + }, order: { valType: 'enumerated', values: ['ascending', 'descending'], dflt: 'ascending', - + editType: 'calc', - + }, editType: 'calc' };