diff --git a/dist/plotly.js b/dist/plotly.js index 951e67d1cd5..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 @@ -5063,76 +5063,76 @@ function alphaShape(alpha, points) { return bnd(ac(alpha, points)) } },{"alpha-complex":66,"simplicial-complex-boundary":507}],68:[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; +} },{}],69:[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) { - if (!isNaN(arr[i])) { - 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) { + if (!isNaN(arr[i])) { + arr[i] = range === 0 ? .5 : (arr[i] - min) / range + } + } + } + } + + return arr; +} },{"array-bounds":68}],70:[function(_dereq_,module,exports){ @@ -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>> 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":117}],121:[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] +}; },{}],122:[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":117,"color-rgba":124,"dtype":170}],123:[function(_dereq_,module,exports){ (function (global){ @@ -17201,305 +17201,305 @@ module.exports = { } },{}],137:[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" +] },{}],138:[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" +] },{}],139:[function(_dereq_,module,exports){ -module.exports=[ - "normal", - "italic", - "oblique" -] +module.exports=[ + "normal", + "italic", + "oblique" +] },{}],140:[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" +] },{}],141:[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":143,"./stringify":144}],142:[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":137}],143:[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":142,"css-font-stretch-keywords":138,"css-font-style-keywords":139,"css-font-weight-keywords":140,"css-global-keywords":145,"css-system-font-keywords":146,"string-split-by":520,"unquote":550}],144:[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":142,"css-font-stretch-keywords":138,"css-font-style-keywords":139,"css-font-weight-keywords":140,"css-global-keywords":145,"css-system-font-keywords":146,"pick-by-alias":463}],145:[function(_dereq_,module,exports){ -module.exports=[ - "inherit", - "initial", - "unset" -] +module.exports=[ + "inherit", + "initial", + "unset" +] },{}],146:[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" +] },{}],147:[function(_dereq_,module,exports){ "use strict" @@ -17566,7 +17566,7 @@ function Procedure() { function compileCwise(user_args) { //Create procedure var proc = new Procedure() - + //Parse blocks proc.pre = user_args.pre proc.body = user_args.body @@ -17621,12 +17621,12 @@ function compileCwise(user_args) { throw new Error("cwise: Unknown argument type " + proc_args[i]) } } - + //Make sure at least one array argument was specified if(proc.arrayArgs.length <= 0) { throw new Error("cwise: No array arguments specified") } - + //Make sure arguments are correct if(proc.pre.args.length > 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"); @@ -34467,7 +34467,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); },{}],165:[function(_dereq_,module,exports){ module.exports = function () { for (var i = 0; i < arguments.length; i++) { @@ -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 @@ -34636,74 +34636,74 @@ function triangulate(points, includePointAtInfinity) { return hull } },{"incremental-convex-hull":412,"uniq":549}],167:[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 +} },{}],168:[function(_dereq_,module,exports){ (function (Buffer){ @@ -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) @@ -37747,9 +37747,9 @@ var Promise$1 = function () { /** `finally` will be invoked regardless of the promise's fate just as native try/catch/finally behaves - + Synchronous example: - + ```js findAuthor() { if (Math.random() > 0.5) { @@ -37757,7 +37757,7 @@ var Promise$1 = function () { } return new Author(); } - + try { return findAuthor(); // succeed or fail } catch(error) { @@ -37767,9 +37767,9 @@ var Promise$1 = function () { // doesn't affect the return value } ``` - + Asynchronous example: - + ```js findAuthor().catch(function(reason){ return findOtherAuther(); @@ -37777,7 +37777,7 @@ var Promise$1 = function () { // author was either found, or not }); ``` - + @method finally @param {Function} callback @return {Promise} @@ -38704,250 +38704,250 @@ function flattenVertexData (data, output, offset) { } },{"dtype":170}],240:[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":144}],241:[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) + } + } +} },{}],242:[function(_dereq_,module,exports){ "use strict" @@ -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){ @@ -55203,134 +55203,134 @@ function createTexture2D(gl) { },{"ndarray":448,"ndarray-ops":443,"typedarray-pool":547}],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":463}],324:[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 } @@ -56901,908 +56901,908 @@ function getName(src) { } },{"atob-lite":75,"glsl-tokenizer":407}],401:[function(_dereq_,module,exports){ -module.exports = tokenize - -var literals100 = _dereq_('./lib/literals') - , operators = _dereq_('./lib/operators') - , builtins100 = _dereq_('./lib/builtins') - , literals300es = _dereq_('./lib/literals-300es') - , builtins300es = _dereq_('./lib/builtins-300es') - -var NORMAL = 999 // <-- never emitted - , TOKEN = 9999 // <-- never emitted - , BLOCK_COMMENT = 0 - , LINE_COMMENT = 1 - , PREPROCESSOR = 2 - , OPERATOR = 3 - , INTEGER = 4 - , FLOAT = 5 - , IDENT = 6 - , BUILTIN = 7 - , KEYWORD = 8 - , WHITESPACE = 9 - , EOF = 10 - , HEX = 11 - -var map = [ - 'block-comment' - , 'line-comment' - , 'preprocessor' - , 'operator' - , 'integer' - , 'float' - , 'ident' - , 'builtin' - , 'keyword' - , 'whitespace' - , 'eof' - , 'integer' -] - -function tokenize(opt) { - var i = 0 - , total = 0 - , mode = NORMAL - , c - , last - , content = [] - , tokens = [] - , token_idx = 0 - , token_offs = 0 - , line = 1 - , col = 0 - , start = 0 - , isnum = false - , isoperator = false - , input = '' - , len - - opt = opt || {} - var allBuiltins = builtins100 - var allLiterals = literals100 - if (opt.version === '300 es') { - allBuiltins = builtins300es - allLiterals = literals300es - } - - // cache by name - var builtinsDict = {}, literalsDict = {} - for (var i = 0; i < allBuiltins.length; i++) { - builtinsDict[allBuiltins[i]] = true - } - for (var i = 0; i < allLiterals.length; i++) { - literalsDict[allLiterals[i]] = true - } - - return function(data) { - tokens = [] - if (data !== null) return write(data) - return end() - } - - function token(data) { - if (data.length) { - tokens.push({ - type: map[mode] - , data: data - , position: start - , line: line - , column: col - }) - } - } - - function write(chunk) { - i = 0 - - if (chunk.toString) chunk = chunk.toString() - - input += chunk.replace(/\r\n/g, '\n') - len = input.length - - - var last - - while(c = input[i], i < len) { - last = i - - switch(mode) { - case BLOCK_COMMENT: i = block_comment(); break - case LINE_COMMENT: i = line_comment(); break - case PREPROCESSOR: i = preprocessor(); break - case OPERATOR: i = operator(); break - case INTEGER: i = integer(); break - case HEX: i = hex(); break - case FLOAT: i = decimal(); break - case TOKEN: i = readtoken(); break - case WHITESPACE: i = whitespace(); break - case NORMAL: i = normal(); break - } - - if(last !== i) { - switch(input[last]) { - case '\n': col = 0; ++line; break - default: ++col; break - } - } - } - - total += i - input = input.slice(i) - return tokens - } - - function end(chunk) { - if(content.length) { - token(content.join('')) - } - - mode = EOF - token('(eof)') - return tokens - } - - function normal() { - content = content.length ? [] : content - - if(last === '/' && c === '*') { - start = total + i - 1 - mode = BLOCK_COMMENT - last = c - return i + 1 - } - - if(last === '/' && c === '/') { - start = total + i - 1 - mode = LINE_COMMENT - last = c - return i + 1 - } - - if(c === '#') { - mode = PREPROCESSOR - start = total + i - return i - } - - if(/\s/.test(c)) { - mode = WHITESPACE - start = total + i - return i - } - - isnum = /\d/.test(c) - isoperator = /[^\w_]/.test(c) - - start = total + i - mode = isnum ? INTEGER : isoperator ? OPERATOR : TOKEN - return i - } - - function whitespace() { - if(/[^\s]/g.test(c)) { - token(content.join('')) - mode = NORMAL - return i - } - content.push(c) - last = c - return i + 1 - } - - function preprocessor() { - if((c === '\r' || c === '\n') && last !== '\\') { - token(content.join('')) - mode = NORMAL - return i - } - content.push(c) - last = c - return i + 1 - } - - function line_comment() { - return preprocessor() - } - - function block_comment() { - if(c === '/' && last === '*') { - content.push(c) - token(content.join('')) - mode = NORMAL - return i + 1 - } - - content.push(c) - last = c - return i + 1 - } - - function operator() { - if(last === '.' && /\d/.test(c)) { - mode = FLOAT - return i - } - - if(last === '/' && c === '*') { - mode = BLOCK_COMMENT - return i - } - - if(last === '/' && c === '/') { - mode = LINE_COMMENT - return i - } - - if(c === '.' && content.length) { - while(determine_operator(content)); - - mode = FLOAT - return i - } - - if(c === ';' || c === ')' || c === '(') { - if(content.length) while(determine_operator(content)); - token(c) - mode = NORMAL - return i + 1 - } - - var is_composite_operator = content.length === 2 && c !== '=' - if(/[\w_\d\s]/.test(c) || is_composite_operator) { - while(determine_operator(content)); - mode = NORMAL - return i - } - - content.push(c) - last = c - return i + 1 - } - - function determine_operator(buf) { - var j = 0 - , idx - , res - - do { - idx = operators.indexOf(buf.slice(0, buf.length + j).join('')) - res = operators[idx] - - if(idx === -1) { - if(j-- + buf.length > 0) continue - res = buf.slice(0, 1).join('') - } - - token(res) - - start += res.length - content = content.slice(res.length) - return content.length - } while(1) - } - - function hex() { - if(/[^a-fA-F0-9]/.test(c)) { - token(content.join('')) - mode = NORMAL - return i - } - - content.push(c) - last = c - return i + 1 - } - - function integer() { - if(c === '.') { - content.push(c) - mode = FLOAT - last = c - return i + 1 - } - - if(/[eE]/.test(c)) { - content.push(c) - mode = FLOAT - last = c - return i + 1 - } - - if(c === 'x' && content.length === 1 && content[0] === '0') { - mode = HEX - content.push(c) - last = c - return i + 1 - } - - if(/[^\d]/.test(c)) { - token(content.join('')) - mode = NORMAL - return i - } - - content.push(c) - last = c - return i + 1 - } - - function decimal() { - if(c === 'f') { - content.push(c) - last = c - i += 1 - } - - if(/[eE]/.test(c)) { - content.push(c) - last = c - return i + 1 - } - - if ((c === '-' || c === '+') && /[eE]/.test(last)) { - content.push(c) - last = c - return i + 1 - } - - if(/[^\d]/.test(c)) { - token(content.join('')) - mode = NORMAL - return i - } - - content.push(c) - last = c - return i + 1 - } - - function readtoken() { - if(/[^\d\w_]/.test(c)) { - var contentstr = content.join('') - if(literalsDict[contentstr]) { - mode = KEYWORD - } else if(builtinsDict[contentstr]) { - mode = BUILTIN - } else { - mode = IDENT - } - token(content.join('')) - mode = NORMAL - return i - } - content.push(c) - last = c - return i + 1 - } -} +module.exports = tokenize + +var literals100 = _dereq_('./lib/literals') + , operators = _dereq_('./lib/operators') + , builtins100 = _dereq_('./lib/builtins') + , literals300es = _dereq_('./lib/literals-300es') + , builtins300es = _dereq_('./lib/builtins-300es') + +var NORMAL = 999 // <-- never emitted + , TOKEN = 9999 // <-- never emitted + , BLOCK_COMMENT = 0 + , LINE_COMMENT = 1 + , PREPROCESSOR = 2 + , OPERATOR = 3 + , INTEGER = 4 + , FLOAT = 5 + , IDENT = 6 + , BUILTIN = 7 + , KEYWORD = 8 + , WHITESPACE = 9 + , EOF = 10 + , HEX = 11 + +var map = [ + 'block-comment' + , 'line-comment' + , 'preprocessor' + , 'operator' + , 'integer' + , 'float' + , 'ident' + , 'builtin' + , 'keyword' + , 'whitespace' + , 'eof' + , 'integer' +] + +function tokenize(opt) { + var i = 0 + , total = 0 + , mode = NORMAL + , c + , last + , content = [] + , tokens = [] + , token_idx = 0 + , token_offs = 0 + , line = 1 + , col = 0 + , start = 0 + , isnum = false + , isoperator = false + , input = '' + , len + + opt = opt || {} + var allBuiltins = builtins100 + var allLiterals = literals100 + if (opt.version === '300 es') { + allBuiltins = builtins300es + allLiterals = literals300es + } + + // cache by name + var builtinsDict = {}, literalsDict = {} + for (var i = 0; i < allBuiltins.length; i++) { + builtinsDict[allBuiltins[i]] = true + } + for (var i = 0; i < allLiterals.length; i++) { + literalsDict[allLiterals[i]] = true + } + + return function(data) { + tokens = [] + if (data !== null) return write(data) + return end() + } + + function token(data) { + if (data.length) { + tokens.push({ + type: map[mode] + , data: data + , position: start + , line: line + , column: col + }) + } + } + + function write(chunk) { + i = 0 + + if (chunk.toString) chunk = chunk.toString() + + input += chunk.replace(/\r\n/g, '\n') + len = input.length + + + var last + + while(c = input[i], i < len) { + last = i + + switch(mode) { + case BLOCK_COMMENT: i = block_comment(); break + case LINE_COMMENT: i = line_comment(); break + case PREPROCESSOR: i = preprocessor(); break + case OPERATOR: i = operator(); break + case INTEGER: i = integer(); break + case HEX: i = hex(); break + case FLOAT: i = decimal(); break + case TOKEN: i = readtoken(); break + case WHITESPACE: i = whitespace(); break + case NORMAL: i = normal(); break + } + + if(last !== i) { + switch(input[last]) { + case '\n': col = 0; ++line; break + default: ++col; break + } + } + } + + total += i + input = input.slice(i) + return tokens + } + + function end(chunk) { + if(content.length) { + token(content.join('')) + } + + mode = EOF + token('(eof)') + return tokens + } + + function normal() { + content = content.length ? [] : content + + if(last === '/' && c === '*') { + start = total + i - 1 + mode = BLOCK_COMMENT + last = c + return i + 1 + } + + if(last === '/' && c === '/') { + start = total + i - 1 + mode = LINE_COMMENT + last = c + return i + 1 + } + + if(c === '#') { + mode = PREPROCESSOR + start = total + i + return i + } + + if(/\s/.test(c)) { + mode = WHITESPACE + start = total + i + return i + } + + isnum = /\d/.test(c) + isoperator = /[^\w_]/.test(c) + + start = total + i + mode = isnum ? INTEGER : isoperator ? OPERATOR : TOKEN + return i + } + + function whitespace() { + if(/[^\s]/g.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } + + function preprocessor() { + if((c === '\r' || c === '\n') && last !== '\\') { + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } + + function line_comment() { + return preprocessor() + } + + function block_comment() { + if(c === '/' && last === '*') { + content.push(c) + token(content.join('')) + mode = NORMAL + return i + 1 + } + + content.push(c) + last = c + return i + 1 + } + + function operator() { + if(last === '.' && /\d/.test(c)) { + mode = FLOAT + return i + } + + if(last === '/' && c === '*') { + mode = BLOCK_COMMENT + return i + } + + if(last === '/' && c === '/') { + mode = LINE_COMMENT + return i + } + + if(c === '.' && content.length) { + while(determine_operator(content)); + + mode = FLOAT + return i + } + + if(c === ';' || c === ')' || c === '(') { + if(content.length) while(determine_operator(content)); + token(c) + mode = NORMAL + return i + 1 + } + + var is_composite_operator = content.length === 2 && c !== '=' + if(/[\w_\d\s]/.test(c) || is_composite_operator) { + while(determine_operator(content)); + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function determine_operator(buf) { + var j = 0 + , idx + , res + + do { + idx = operators.indexOf(buf.slice(0, buf.length + j).join('')) + res = operators[idx] + + if(idx === -1) { + if(j-- + buf.length > 0) continue + res = buf.slice(0, 1).join('') + } + + token(res) + + start += res.length + content = content.slice(res.length) + return content.length + } while(1) + } + + function hex() { + if(/[^a-fA-F0-9]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function integer() { + if(c === '.') { + content.push(c) + mode = FLOAT + last = c + return i + 1 + } + + if(/[eE]/.test(c)) { + content.push(c) + mode = FLOAT + last = c + return i + 1 + } + + if(c === 'x' && content.length === 1 && content[0] === '0') { + mode = HEX + content.push(c) + last = c + return i + 1 + } + + if(/[^\d]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function decimal() { + if(c === 'f') { + content.push(c) + last = c + i += 1 + } + + if(/[eE]/.test(c)) { + content.push(c) + last = c + return i + 1 + } + + if ((c === '-' || c === '+') && /[eE]/.test(last)) { + content.push(c) + last = c + return i + 1 + } + + if(/[^\d]/.test(c)) { + token(content.join('')) + mode = NORMAL + return i + } + + content.push(c) + last = c + return i + 1 + } + + function readtoken() { + if(/[^\d\w_]/.test(c)) { + var contentstr = content.join('') + if(literalsDict[contentstr]) { + mode = KEYWORD + } else if(builtinsDict[contentstr]) { + mode = BUILTIN + } else { + mode = IDENT + } + token(content.join('')) + mode = NORMAL + return i + } + content.push(c) + last = c + return i + 1 + } +} },{"./lib/builtins":403,"./lib/builtins-300es":402,"./lib/literals":405,"./lib/literals-300es":404,"./lib/operators":406}],402:[function(_dereq_,module,exports){ -// 300es builtins/reserved words that were previously valid in v100 -var v100 = _dereq_('./builtins') - -// The texture2D|Cube functions have been removed -// And the gl_ features are updated -v100 = v100.slice().filter(function (b) { - return !/^(gl\_|texture)/.test(b) -}) - -module.exports = v100.concat([ - // the updated gl_ constants - 'gl_VertexID' - , 'gl_InstanceID' - , 'gl_Position' - , 'gl_PointSize' - , 'gl_FragCoord' - , 'gl_FrontFacing' - , 'gl_FragDepth' - , 'gl_PointCoord' - , 'gl_MaxVertexAttribs' - , 'gl_MaxVertexUniformVectors' - , 'gl_MaxVertexOutputVectors' - , 'gl_MaxFragmentInputVectors' - , 'gl_MaxVertexTextureImageUnits' - , 'gl_MaxCombinedTextureImageUnits' - , 'gl_MaxTextureImageUnits' - , 'gl_MaxFragmentUniformVectors' - , 'gl_MaxDrawBuffers' - , 'gl_MinProgramTexelOffset' - , 'gl_MaxProgramTexelOffset' - , 'gl_DepthRangeParameters' - , 'gl_DepthRange' - - // other builtins - , 'trunc' - , 'round' - , 'roundEven' - , 'isnan' - , 'isinf' - , 'floatBitsToInt' - , 'floatBitsToUint' - , 'intBitsToFloat' - , 'uintBitsToFloat' - , 'packSnorm2x16' - , 'unpackSnorm2x16' - , 'packUnorm2x16' - , 'unpackUnorm2x16' - , 'packHalf2x16' - , 'unpackHalf2x16' - , 'outerProduct' - , 'transpose' - , 'determinant' - , 'inverse' - , 'texture' - , 'textureSize' - , 'textureProj' - , 'textureLod' - , 'textureOffset' - , 'texelFetch' - , 'texelFetchOffset' - , 'textureProjOffset' - , 'textureLodOffset' - , 'textureProjLod' - , 'textureProjLodOffset' - , 'textureGrad' - , 'textureGradOffset' - , 'textureProjGrad' - , 'textureProjGradOffset' -]) +// 300es builtins/reserved words that were previously valid in v100 +var v100 = _dereq_('./builtins') + +// The texture2D|Cube functions have been removed +// And the gl_ features are updated +v100 = v100.slice().filter(function (b) { + return !/^(gl\_|texture)/.test(b) +}) + +module.exports = v100.concat([ + // the updated gl_ constants + 'gl_VertexID' + , 'gl_InstanceID' + , 'gl_Position' + , 'gl_PointSize' + , 'gl_FragCoord' + , 'gl_FrontFacing' + , 'gl_FragDepth' + , 'gl_PointCoord' + , 'gl_MaxVertexAttribs' + , 'gl_MaxVertexUniformVectors' + , 'gl_MaxVertexOutputVectors' + , 'gl_MaxFragmentInputVectors' + , 'gl_MaxVertexTextureImageUnits' + , 'gl_MaxCombinedTextureImageUnits' + , 'gl_MaxTextureImageUnits' + , 'gl_MaxFragmentUniformVectors' + , 'gl_MaxDrawBuffers' + , 'gl_MinProgramTexelOffset' + , 'gl_MaxProgramTexelOffset' + , 'gl_DepthRangeParameters' + , 'gl_DepthRange' + + // other builtins + , 'trunc' + , 'round' + , 'roundEven' + , 'isnan' + , 'isinf' + , 'floatBitsToInt' + , 'floatBitsToUint' + , 'intBitsToFloat' + , 'uintBitsToFloat' + , 'packSnorm2x16' + , 'unpackSnorm2x16' + , 'packUnorm2x16' + , 'unpackUnorm2x16' + , 'packHalf2x16' + , 'unpackHalf2x16' + , 'outerProduct' + , 'transpose' + , 'determinant' + , 'inverse' + , 'texture' + , 'textureSize' + , 'textureProj' + , 'textureLod' + , 'textureOffset' + , 'texelFetch' + , 'texelFetchOffset' + , 'textureProjOffset' + , 'textureLodOffset' + , 'textureProjLod' + , 'textureProjLodOffset' + , 'textureGrad' + , 'textureGradOffset' + , 'textureProjGrad' + , 'textureProjGradOffset' +]) },{"./builtins":403}],403:[function(_dereq_,module,exports){ -module.exports = [ - // Keep this list sorted - 'abs' - , 'acos' - , 'all' - , 'any' - , 'asin' - , 'atan' - , 'ceil' - , 'clamp' - , 'cos' - , 'cross' - , 'dFdx' - , 'dFdy' - , 'degrees' - , 'distance' - , 'dot' - , 'equal' - , 'exp' - , 'exp2' - , 'faceforward' - , 'floor' - , 'fract' - , 'gl_BackColor' - , 'gl_BackLightModelProduct' - , 'gl_BackLightProduct' - , 'gl_BackMaterial' - , 'gl_BackSecondaryColor' - , 'gl_ClipPlane' - , 'gl_ClipVertex' - , 'gl_Color' - , 'gl_DepthRange' - , 'gl_DepthRangeParameters' - , 'gl_EyePlaneQ' - , 'gl_EyePlaneR' - , 'gl_EyePlaneS' - , 'gl_EyePlaneT' - , 'gl_Fog' - , 'gl_FogCoord' - , 'gl_FogFragCoord' - , 'gl_FogParameters' - , 'gl_FragColor' - , 'gl_FragCoord' - , 'gl_FragData' - , 'gl_FragDepth' - , 'gl_FragDepthEXT' - , 'gl_FrontColor' - , 'gl_FrontFacing' - , 'gl_FrontLightModelProduct' - , 'gl_FrontLightProduct' - , 'gl_FrontMaterial' - , 'gl_FrontSecondaryColor' - , 'gl_LightModel' - , 'gl_LightModelParameters' - , 'gl_LightModelProducts' - , 'gl_LightProducts' - , 'gl_LightSource' - , 'gl_LightSourceParameters' - , 'gl_MaterialParameters' - , 'gl_MaxClipPlanes' - , 'gl_MaxCombinedTextureImageUnits' - , 'gl_MaxDrawBuffers' - , 'gl_MaxFragmentUniformComponents' - , 'gl_MaxLights' - , 'gl_MaxTextureCoords' - , 'gl_MaxTextureImageUnits' - , 'gl_MaxTextureUnits' - , 'gl_MaxVaryingFloats' - , 'gl_MaxVertexAttribs' - , 'gl_MaxVertexTextureImageUnits' - , 'gl_MaxVertexUniformComponents' - , 'gl_ModelViewMatrix' - , 'gl_ModelViewMatrixInverse' - , 'gl_ModelViewMatrixInverseTranspose' - , 'gl_ModelViewMatrixTranspose' - , 'gl_ModelViewProjectionMatrix' - , 'gl_ModelViewProjectionMatrixInverse' - , 'gl_ModelViewProjectionMatrixInverseTranspose' - , 'gl_ModelViewProjectionMatrixTranspose' - , 'gl_MultiTexCoord0' - , 'gl_MultiTexCoord1' - , 'gl_MultiTexCoord2' - , 'gl_MultiTexCoord3' - , 'gl_MultiTexCoord4' - , 'gl_MultiTexCoord5' - , 'gl_MultiTexCoord6' - , 'gl_MultiTexCoord7' - , 'gl_Normal' - , 'gl_NormalMatrix' - , 'gl_NormalScale' - , 'gl_ObjectPlaneQ' - , 'gl_ObjectPlaneR' - , 'gl_ObjectPlaneS' - , 'gl_ObjectPlaneT' - , 'gl_Point' - , 'gl_PointCoord' - , 'gl_PointParameters' - , 'gl_PointSize' - , 'gl_Position' - , 'gl_ProjectionMatrix' - , 'gl_ProjectionMatrixInverse' - , 'gl_ProjectionMatrixInverseTranspose' - , 'gl_ProjectionMatrixTranspose' - , 'gl_SecondaryColor' - , 'gl_TexCoord' - , 'gl_TextureEnvColor' - , 'gl_TextureMatrix' - , 'gl_TextureMatrixInverse' - , 'gl_TextureMatrixInverseTranspose' - , 'gl_TextureMatrixTranspose' - , 'gl_Vertex' - , 'greaterThan' - , 'greaterThanEqual' - , 'inversesqrt' - , 'length' - , 'lessThan' - , 'lessThanEqual' - , 'log' - , 'log2' - , 'matrixCompMult' - , 'max' - , 'min' - , 'mix' - , 'mod' - , 'normalize' - , 'not' - , 'notEqual' - , 'pow' - , 'radians' - , 'reflect' - , 'refract' - , 'sign' - , 'sin' - , 'smoothstep' - , 'sqrt' - , 'step' - , 'tan' - , 'texture2D' - , 'texture2DLod' - , 'texture2DProj' - , 'texture2DProjLod' - , 'textureCube' - , 'textureCubeLod' - , 'texture2DLodEXT' - , 'texture2DProjLodEXT' - , 'textureCubeLodEXT' - , 'texture2DGradEXT' - , 'texture2DProjGradEXT' - , 'textureCubeGradEXT' -] +module.exports = [ + // Keep this list sorted + 'abs' + , 'acos' + , 'all' + , 'any' + , 'asin' + , 'atan' + , 'ceil' + , 'clamp' + , 'cos' + , 'cross' + , 'dFdx' + , 'dFdy' + , 'degrees' + , 'distance' + , 'dot' + , 'equal' + , 'exp' + , 'exp2' + , 'faceforward' + , 'floor' + , 'fract' + , 'gl_BackColor' + , 'gl_BackLightModelProduct' + , 'gl_BackLightProduct' + , 'gl_BackMaterial' + , 'gl_BackSecondaryColor' + , 'gl_ClipPlane' + , 'gl_ClipVertex' + , 'gl_Color' + , 'gl_DepthRange' + , 'gl_DepthRangeParameters' + , 'gl_EyePlaneQ' + , 'gl_EyePlaneR' + , 'gl_EyePlaneS' + , 'gl_EyePlaneT' + , 'gl_Fog' + , 'gl_FogCoord' + , 'gl_FogFragCoord' + , 'gl_FogParameters' + , 'gl_FragColor' + , 'gl_FragCoord' + , 'gl_FragData' + , 'gl_FragDepth' + , 'gl_FragDepthEXT' + , 'gl_FrontColor' + , 'gl_FrontFacing' + , 'gl_FrontLightModelProduct' + , 'gl_FrontLightProduct' + , 'gl_FrontMaterial' + , 'gl_FrontSecondaryColor' + , 'gl_LightModel' + , 'gl_LightModelParameters' + , 'gl_LightModelProducts' + , 'gl_LightProducts' + , 'gl_LightSource' + , 'gl_LightSourceParameters' + , 'gl_MaterialParameters' + , 'gl_MaxClipPlanes' + , 'gl_MaxCombinedTextureImageUnits' + , 'gl_MaxDrawBuffers' + , 'gl_MaxFragmentUniformComponents' + , 'gl_MaxLights' + , 'gl_MaxTextureCoords' + , 'gl_MaxTextureImageUnits' + , 'gl_MaxTextureUnits' + , 'gl_MaxVaryingFloats' + , 'gl_MaxVertexAttribs' + , 'gl_MaxVertexTextureImageUnits' + , 'gl_MaxVertexUniformComponents' + , 'gl_ModelViewMatrix' + , 'gl_ModelViewMatrixInverse' + , 'gl_ModelViewMatrixInverseTranspose' + , 'gl_ModelViewMatrixTranspose' + , 'gl_ModelViewProjectionMatrix' + , 'gl_ModelViewProjectionMatrixInverse' + , 'gl_ModelViewProjectionMatrixInverseTranspose' + , 'gl_ModelViewProjectionMatrixTranspose' + , 'gl_MultiTexCoord0' + , 'gl_MultiTexCoord1' + , 'gl_MultiTexCoord2' + , 'gl_MultiTexCoord3' + , 'gl_MultiTexCoord4' + , 'gl_MultiTexCoord5' + , 'gl_MultiTexCoord6' + , 'gl_MultiTexCoord7' + , 'gl_Normal' + , 'gl_NormalMatrix' + , 'gl_NormalScale' + , 'gl_ObjectPlaneQ' + , 'gl_ObjectPlaneR' + , 'gl_ObjectPlaneS' + , 'gl_ObjectPlaneT' + , 'gl_Point' + , 'gl_PointCoord' + , 'gl_PointParameters' + , 'gl_PointSize' + , 'gl_Position' + , 'gl_ProjectionMatrix' + , 'gl_ProjectionMatrixInverse' + , 'gl_ProjectionMatrixInverseTranspose' + , 'gl_ProjectionMatrixTranspose' + , 'gl_SecondaryColor' + , 'gl_TexCoord' + , 'gl_TextureEnvColor' + , 'gl_TextureMatrix' + , 'gl_TextureMatrixInverse' + , 'gl_TextureMatrixInverseTranspose' + , 'gl_TextureMatrixTranspose' + , 'gl_Vertex' + , 'greaterThan' + , 'greaterThanEqual' + , 'inversesqrt' + , 'length' + , 'lessThan' + , 'lessThanEqual' + , 'log' + , 'log2' + , 'matrixCompMult' + , 'max' + , 'min' + , 'mix' + , 'mod' + , 'normalize' + , 'not' + , 'notEqual' + , 'pow' + , 'radians' + , 'reflect' + , 'refract' + , 'sign' + , 'sin' + , 'smoothstep' + , 'sqrt' + , 'step' + , 'tan' + , 'texture2D' + , 'texture2DLod' + , 'texture2DProj' + , 'texture2DProjLod' + , 'textureCube' + , 'textureCubeLod' + , 'texture2DLodEXT' + , 'texture2DProjLodEXT' + , 'textureCubeLodEXT' + , 'texture2DGradEXT' + , 'texture2DProjGradEXT' + , 'textureCubeGradEXT' +] },{}],404:[function(_dereq_,module,exports){ -var v100 = _dereq_('./literals') - -module.exports = v100.slice().concat([ - 'layout' - , 'centroid' - , 'smooth' - , 'case' - , 'mat2x2' - , 'mat2x3' - , 'mat2x4' - , 'mat3x2' - , 'mat3x3' - , 'mat3x4' - , 'mat4x2' - , 'mat4x3' - , 'mat4x4' - , 'uvec2' - , 'uvec3' - , 'uvec4' - , 'samplerCubeShadow' - , 'sampler2DArray' - , 'sampler2DArrayShadow' - , 'isampler2D' - , 'isampler3D' - , 'isamplerCube' - , 'isampler2DArray' - , 'usampler2D' - , 'usampler3D' - , 'usamplerCube' - , 'usampler2DArray' - , 'coherent' - , 'restrict' - , 'readonly' - , 'writeonly' - , 'resource' - , 'atomic_uint' - , 'noperspective' - , 'patch' - , 'sample' - , 'subroutine' - , 'common' - , 'partition' - , 'active' - , 'filter' - , 'image1D' - , 'image2D' - , 'image3D' - , 'imageCube' - , 'iimage1D' - , 'iimage2D' - , 'iimage3D' - , 'iimageCube' - , 'uimage1D' - , 'uimage2D' - , 'uimage3D' - , 'uimageCube' - , 'image1DArray' - , 'image2DArray' - , 'iimage1DArray' - , 'iimage2DArray' - , 'uimage1DArray' - , 'uimage2DArray' - , 'image1DShadow' - , 'image2DShadow' - , 'image1DArrayShadow' - , 'image2DArrayShadow' - , 'imageBuffer' - , 'iimageBuffer' - , 'uimageBuffer' - , 'sampler1DArray' - , 'sampler1DArrayShadow' - , 'isampler1D' - , 'isampler1DArray' - , 'usampler1D' - , 'usampler1DArray' - , 'isampler2DRect' - , 'usampler2DRect' - , 'samplerBuffer' - , 'isamplerBuffer' - , 'usamplerBuffer' - , 'sampler2DMS' - , 'isampler2DMS' - , 'usampler2DMS' - , 'sampler2DMSArray' - , 'isampler2DMSArray' - , 'usampler2DMSArray' -]) +var v100 = _dereq_('./literals') + +module.exports = v100.slice().concat([ + 'layout' + , 'centroid' + , 'smooth' + , 'case' + , 'mat2x2' + , 'mat2x3' + , 'mat2x4' + , 'mat3x2' + , 'mat3x3' + , 'mat3x4' + , 'mat4x2' + , 'mat4x3' + , 'mat4x4' + , 'uvec2' + , 'uvec3' + , 'uvec4' + , 'samplerCubeShadow' + , 'sampler2DArray' + , 'sampler2DArrayShadow' + , 'isampler2D' + , 'isampler3D' + , 'isamplerCube' + , 'isampler2DArray' + , 'usampler2D' + , 'usampler3D' + , 'usamplerCube' + , 'usampler2DArray' + , 'coherent' + , 'restrict' + , 'readonly' + , 'writeonly' + , 'resource' + , 'atomic_uint' + , 'noperspective' + , 'patch' + , 'sample' + , 'subroutine' + , 'common' + , 'partition' + , 'active' + , 'filter' + , 'image1D' + , 'image2D' + , 'image3D' + , 'imageCube' + , 'iimage1D' + , 'iimage2D' + , 'iimage3D' + , 'iimageCube' + , 'uimage1D' + , 'uimage2D' + , 'uimage3D' + , 'uimageCube' + , 'image1DArray' + , 'image2DArray' + , 'iimage1DArray' + , 'iimage2DArray' + , 'uimage1DArray' + , 'uimage2DArray' + , 'image1DShadow' + , 'image2DShadow' + , 'image1DArrayShadow' + , 'image2DArrayShadow' + , 'imageBuffer' + , 'iimageBuffer' + , 'uimageBuffer' + , 'sampler1DArray' + , 'sampler1DArrayShadow' + , 'isampler1D' + , 'isampler1DArray' + , 'usampler1D' + , 'usampler1DArray' + , 'isampler2DRect' + , 'usampler2DRect' + , 'samplerBuffer' + , 'isamplerBuffer' + , 'usamplerBuffer' + , 'sampler2DMS' + , 'isampler2DMS' + , 'usampler2DMS' + , 'sampler2DMSArray' + , 'isampler2DMSArray' + , 'usampler2DMSArray' +]) },{"./literals":405}],405:[function(_dereq_,module,exports){ -module.exports = [ - // current - 'precision' - , 'highp' - , 'mediump' - , 'lowp' - , 'attribute' - , 'const' - , 'uniform' - , 'varying' - , 'break' - , 'continue' - , 'do' - , 'for' - , 'while' - , 'if' - , 'else' - , 'in' - , 'out' - , 'inout' - , 'float' - , 'int' - , 'uint' - , 'void' - , 'bool' - , 'true' - , 'false' - , 'discard' - , 'return' - , 'mat2' - , 'mat3' - , 'mat4' - , 'vec2' - , 'vec3' - , 'vec4' - , 'ivec2' - , 'ivec3' - , 'ivec4' - , 'bvec2' - , 'bvec3' - , 'bvec4' - , 'sampler1D' - , 'sampler2D' - , 'sampler3D' - , 'samplerCube' - , 'sampler1DShadow' - , 'sampler2DShadow' - , 'struct' - - // future - , 'asm' - , 'class' - , 'union' - , 'enum' - , 'typedef' - , 'template' - , 'this' - , 'packed' - , 'goto' - , 'switch' - , 'default' - , 'inline' - , 'noinline' - , 'volatile' - , 'public' - , 'static' - , 'extern' - , 'external' - , 'interface' - , 'long' - , 'short' - , 'double' - , 'half' - , 'fixed' - , 'unsigned' - , 'input' - , 'output' - , 'hvec2' - , 'hvec3' - , 'hvec4' - , 'dvec2' - , 'dvec3' - , 'dvec4' - , 'fvec2' - , 'fvec3' - , 'fvec4' - , 'sampler2DRect' - , 'sampler3DRect' - , 'sampler2DRectShadow' - , 'sizeof' - , 'cast' - , 'namespace' - , 'using' -] +module.exports = [ + // current + 'precision' + , 'highp' + , 'mediump' + , 'lowp' + , 'attribute' + , 'const' + , 'uniform' + , 'varying' + , 'break' + , 'continue' + , 'do' + , 'for' + , 'while' + , 'if' + , 'else' + , 'in' + , 'out' + , 'inout' + , 'float' + , 'int' + , 'uint' + , 'void' + , 'bool' + , 'true' + , 'false' + , 'discard' + , 'return' + , 'mat2' + , 'mat3' + , 'mat4' + , 'vec2' + , 'vec3' + , 'vec4' + , 'ivec2' + , 'ivec3' + , 'ivec4' + , 'bvec2' + , 'bvec3' + , 'bvec4' + , 'sampler1D' + , 'sampler2D' + , 'sampler3D' + , 'samplerCube' + , 'sampler1DShadow' + , 'sampler2DShadow' + , 'struct' + + // future + , 'asm' + , 'class' + , 'union' + , 'enum' + , 'typedef' + , 'template' + , 'this' + , 'packed' + , 'goto' + , 'switch' + , 'default' + , 'inline' + , 'noinline' + , 'volatile' + , 'public' + , 'static' + , 'extern' + , 'external' + , 'interface' + , 'long' + , 'short' + , 'double' + , 'half' + , 'fixed' + , 'unsigned' + , 'input' + , 'output' + , 'hvec2' + , 'hvec3' + , 'hvec4' + , 'dvec2' + , 'dvec3' + , 'dvec4' + , 'fvec2' + , 'fvec3' + , 'fvec4' + , 'sampler2DRect' + , 'sampler3DRect' + , 'sampler2DRectShadow' + , 'sizeof' + , 'cast' + , 'namespace' + , 'using' +] },{}],406:[function(_dereq_,module,exports){ -module.exports = [ - '<<=' - , '>>=' - , '++' - , '--' - , '<<' - , '>>' - , '<=' - , '>=' - , '==' - , '!=' - , '&&' - , '||' - , '+=' - , '-=' - , '*=' - , '/=' - , '%=' - , '&=' - , '^^' - , '^=' - , '|=' - , '(' - , ')' - , '[' - , ']' - , '.' - , '!' - , '~' - , '*' - , '/' - , '%' - , '+' - , '-' - , '<' - , '>' - , '&' - , '^' - , '|' - , '?' - , ':' - , '=' - , ',' - , ';' - , '{' - , '}' -] +module.exports = [ + '<<=' + , '>>=' + , '++' + , '--' + , '<<' + , '>>' + , '<=' + , '>=' + , '==' + , '!=' + , '&&' + , '||' + , '+=' + , '-=' + , '*=' + , '/=' + , '%=' + , '&=' + , '^^' + , '^=' + , '|=' + , '(' + , ')' + , '[' + , ']' + , '.' + , '!' + , '~' + , '*' + , '/' + , '%' + , '+' + , '-' + , '<' + , '>' + , '&' + , '^' + , '|' + , '?' + , ':' + , '=' + , ',' + , ';' + , '{' + , '}' +] },{}],407:[function(_dereq_,module,exports){ -var tokenize = _dereq_('./index') - -module.exports = tokenizeString - -function tokenizeString(str, opt) { - var generator = tokenize(opt) - var tokens = [] - - tokens = tokens.concat(generator(str)) - tokens = tokens.concat(generator(null)) - - return tokens -} +var tokenize = _dereq_('./index') + +module.exports = tokenizeString + +function tokenizeString(str, opt) { + var generator = tokenize(opt) + var tokens = [] + + tokens = tokens.concat(generator(str)) + tokens = tokens.concat(generator(null)) + + return tokens +} },{"./index":401}],408:[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('') +} },{}],409:[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}],410:[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}],411:[function(_dereq_,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { @@ -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 && - ua.indexOf('Macintosh') !== -1 && - ua.indexOf('Safari') !== -1 - ) { - result = true - } - - return result -} +'use strict' + +module.exports = isMobile +module.exports.isMobile = isMobile +module.exports.default = isMobile + +var mobileRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i + +var tabletRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino|android|ipad|playbook|silk/i + +function isMobile (opts) { + if (!opts) opts = {} + var ua = opts.ua + if (!ua && typeof navigator !== 'undefined') ua = navigator.userAgent + if (ua && ua.headers && typeof ua.headers['user-agent'] === 'string') { + ua = ua.headers['user-agent'] + } + if (typeof ua !== 'string') return false + + var result = opts.tablet ? tabletRE.test(ua) : mobileRE.test(ua) + + if ( + !result && + opts.tablet && + opts.featureDetect && + navigator && + navigator.maxTouchPoints > 1 && + ua.indexOf('Macintosh') !== -1 && + ua.indexOf('Safari') !== -1 + ) { + result = true + } + + return result +} },{}],421:[function(_dereq_,module,exports){ 'use strict'; @@ -58814,55 +58814,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) { @@ -58950,7 +58950,7 @@ function constructCell(dimension, mask) { } } } - + //Preprocess points so first d+1 points are linearly independent var hull = chull(points) var faces = [] @@ -59059,7 +59059,7 @@ module.exports = function decomposeMat4(matrix, translation, scale, skew, perspe //multiply by transposed inverse perspective matrix, into perspective vec4 vec4multMat4(perspective, tmpVec4, perspectiveMatrix) - } else { + } else { //no perspective perspective[0] = perspective[1] = perspective[2] = 0 perspective[3] = 1 @@ -59142,7 +59142,7 @@ function mat3from4(out, mat4x4) { out[0][0] = mat4x4[0] out[0][1] = mat4x4[1] out[0][2] = mat4x4[2] - + out[1][0] = mat4x4[4] out[1][1] = mat4x4[5] out[1][2] = mat4x4[6] @@ -59161,7 +59161,7 @@ function combine(out, a, b, scale1, scale2) { module.exports = function normalize(out, mat) { var m44 = mat[15] // Cannot normalize. - if (m44 === 0) + if (m44 === 0) return false var scale = 1 / m44 for (var i=0; i<16; i++) @@ -59189,7 +59189,7 @@ function interpolate(out, start, end, alpha) { var r0 = decompose(start, state0.translate, state0.scale, state0.skew, state0.perspective, state0.quaternion) var r1 = decompose(end, state1.translate, state1.scale, state1.skew, state1.perspective, state1.quaternion) if (!r0 || !r1) - return false + return false //now lerp/slerp the start and end components into a temporary lerp(tmptranslate, state0.translate, state1.translate, alpha) @@ -59256,7 +59256,7 @@ module.exports = function recomposeMat4(matrix, translation, scale, skew, perspe matrix[7] = perspective[1] matrix[11] = perspective[2] matrix[15] = perspective[3] - + // apply skew // temp is a identity 4x4 matrix initially mat4.identity(temp) @@ -59289,204 +59289,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":434,"gl-mat4/invert":273,"gl-mat4/lookAt":274,"gl-mat4/rotateX":279,"gl-mat4/rotateY":280,"gl-mat4/rotateZ":281,"gl-mat4/scale":282,"gl-mat4/translate":283,"gl-vec3/normalize":356,"mat4-interpolate":430}],434:[function(_dereq_,module,exports){ arguments[4][238][0].apply(exports,arguments) @@ -59539,8 +59539,8 @@ function monotoneConvexHull2D(points) { //Insert into lower list var m = lower.length while(m > 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) @@ -63376,91 +63376,91 @@ parenthesis.stringify = stringify module.exports = parenthesis },{}],457:[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":463}],458:[function(_dereq_,module,exports){ @@ -63712,83 +63712,83 @@ exports.rank = rank exports.unrank = unrank },{"invert-permutation":415,"typedarray-pool":547}],463:[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 +} },{}],464:[function(_dereq_,module,exports){ "use strict" @@ -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; @@ -69074,426 +69074,426 @@ var reglScatter2d = function reglScatter2d(regl, options) { module.exports = reglScatter2d; },{"array-bounds":68,"color-id":120,"color-normalize":122,"flatten-vertex-data":239,"glslify":408,"is-iexplorer":419,"object-assign":452,"parse-rect":457,"pick-by-alias":463,"point-cluster":467,"to-float32":529,"update-diff":551}],491:[function(_dereq_,module,exports){ -'use strict' - - -var createScatter = _dereq_('regl-scatter2d') -var pick = _dereq_('pick-by-alias') -var getBounds = _dereq_('array-bounds') -var raf = _dereq_('raf') -var arrRange = _dereq_('array-range') -var rect = _dereq_('parse-rect') -var flatten = _dereq_('flatten-vertex-data') - - -module.exports = SPLOM - - -// @constructor -function SPLOM (regl, options) { - if (!(this instanceof SPLOM)) { return new SPLOM(regl, options) } - - // render passes - this.traces = [] - - // passes for scatter, combined across traces - this.passes = {} - - this.regl = regl - - // main scatter drawing instance - this.scatter = createScatter(regl) - - this.canvas = this.scatter.canvas -} - - -// update & draw passes once per frame +'use strict' + + +var createScatter = _dereq_('regl-scatter2d') +var pick = _dereq_('pick-by-alias') +var getBounds = _dereq_('array-bounds') +var raf = _dereq_('raf') +var arrRange = _dereq_('array-range') +var rect = _dereq_('parse-rect') +var flatten = _dereq_('flatten-vertex-data') + + +module.exports = SPLOM + + +// @constructor +function SPLOM (regl, options) { + if (!(this instanceof SPLOM)) { return new SPLOM(regl, options) } + + // render passes + this.traces = [] + + // passes for scatter, combined across traces + this.passes = {} + + this.regl = regl + + // main scatter drawing instance + this.scatter = createScatter(regl) + + this.canvas = this.scatter.canvas +} + + +// update & draw passes once per frame SPLOM.prototype.render = function () { var this$1 = this; var ref; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - if (args.length) { - (ref = this).update.apply(ref, args) - } - - if (this.regl.attributes.preserveDrawingBuffer) { return this.draw() } - - // make sure draw is not called more often than once a frame - if (this.dirty) { - if (this.planned == null) { - this.planned = raf(function () { - this$1.draw() - this$1.dirty = true - this$1.planned = null - }) - } - } - else { - this.draw() - this.dirty = true - raf(function () { - this$1.dirty = false - }) - } - - return this -} - - -// update passes + while ( len-- ) args[ len ] = arguments[ len ]; + if (args.length) { + (ref = this).update.apply(ref, args) + } + + if (this.regl.attributes.preserveDrawingBuffer) { return this.draw() } + + // make sure draw is not called more often than once a frame + if (this.dirty) { + if (this.planned == null) { + this.planned = raf(function () { + this$1.draw() + this$1.dirty = true + this$1.planned = null + }) + } + } + else { + this.draw() + this.dirty = true + raf(function () { + this$1.dirty = false + }) + } + + return this +} + + +// update passes SPLOM.prototype.update = function () { var ref; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - if (!args.length) { return } - - for (var i = 0; i < args.length; i++) { - this.updateItem(i, args[i]) - } - - // remove nulled passes - this.traces = this.traces.filter(Boolean) - - // FIXME: update passes independently - var passes = [] - var offset = 0 - for (var i$1 = 0; i$1 < this.traces.length; i$1++) { - var trace = this.traces[i$1] - var tracePasses = this.traces[i$1].passes - for (var j = 0; j < tracePasses.length; j++) { - passes.push(this.passes[tracePasses[j]]) - } - // save offset of passes - trace.passOffset = offset - offset += trace.passes.length - } - - (ref = this.scatter).update.apply(ref, passes) - - return this -} - - -// update trace by index, not supposed to be called directly -SPLOM.prototype.updateItem = function (i, options) { + while ( len-- ) args[ len ] = arguments[ len ]; + if (!args.length) { return } + + for (var i = 0; i < args.length; i++) { + this.updateItem(i, args[i]) + } + + // remove nulled passes + this.traces = this.traces.filter(Boolean) + + // FIXME: update passes independently + var passes = [] + var offset = 0 + for (var i$1 = 0; i$1 < this.traces.length; i$1++) { + var trace = this.traces[i$1] + var tracePasses = this.traces[i$1].passes + for (var j = 0; j < tracePasses.length; j++) { + passes.push(this.passes[tracePasses[j]]) + } + // save offset of passes + trace.passOffset = offset + offset += trace.passes.length + } + + (ref = this.scatter).update.apply(ref, passes) + + return this +} + + +// update trace by index, not supposed to be called directly +SPLOM.prototype.updateItem = function (i, options) { var ref = this; - var regl = ref.regl; - - // remove pass if null - if (options === null) { - this.traces[i] = null - return this - } - - if (!options) { return this } - - var o = pick(options, { - data: 'data items columns rows values dimensions samples x', - snap: 'snap cluster', - size: 'sizes size radius', - color: 'colors color fill fill-color fillColor', - opacity: 'opacity alpha transparency opaque', - borderSize: 'borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline', - borderColor: 'borderColors borderColor bordercolor stroke stroke-color strokeColor', - marker: 'markers marker shape', - range: 'range ranges databox dataBox', - viewport: 'viewport viewBox viewbox', - domain: 'domain domains area areas', - padding: 'pad padding paddings pads margin margins', - transpose: 'transpose transposed', - diagonal: 'diagonal diag showDiagonal', - upper: 'upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf', - lower: 'lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower' - }) - - // we provide regl buffer per-trace, since trace data can be changed - var trace = (this.traces[i] || (this.traces[i] = { - id: i, - buffer: regl.buffer({ - usage: 'dynamic', - type: 'float', - data: new Uint8Array() - }), - color: 'black', - marker: null, - size: 12, - borderColor: 'transparent', - borderSize: 1, - viewport: rect([regl._gl.drawingBufferWidth, regl._gl.drawingBufferHeight]), - padding: [0, 0, 0, 0], - opacity: 1, - diagonal: true, - upper: true, - lower: true - })) - - - // save styles - if (o.color != null) { - trace.color = o.color - } - if (o.size != null) { - trace.size = o.size - } - if (o.marker != null) { - trace.marker = o.marker - } - if (o.borderColor != null) { - trace.borderColor = o.borderColor - } - if (o.borderSize != null) { - trace.borderSize = o.borderSize - } - if (o.opacity != null) { - trace.opacity = o.opacity - } - if (o.viewport) { - trace.viewport = rect(o.viewport) - } - if (o.diagonal != null) { trace.diagonal = o.diagonal } - if (o.upper != null) { trace.upper = o.upper } - if (o.lower != null) { trace.lower = o.lower } - - // put flattened data into buffer - if (o.data) { - trace.buffer(flatten(o.data)) - trace.columns = o.data.length - trace.count = o.data[0].length - - // detect bounds per-column - trace.bounds = [] - - for (var i$1 = 0; i$1 < trace.columns; i$1++) { - trace.bounds[i$1] = getBounds(o.data[i$1], 1) - } - } - - // add proper range updating markers - var multirange - if (o.range) { - trace.range = o.range - multirange = trace.range && typeof trace.range[0] !== 'number' - } - - if (o.domain) { - trace.domain = o.domain - } - var multipadding = false - if (o.padding != null) { - // multiple paddings - if (Array.isArray(o.padding) && o.padding.length === trace.columns && typeof o.padding[o.padding.length - 1] === 'number') { - trace.padding = o.padding.map(getPad) - multipadding = true - } - // single padding - else { - trace.padding = getPad(o.padding) - } - } - - // create passes - var m = trace.columns - var n = trace.count - - var w = trace.viewport.width - var h = trace.viewport.height - var left = trace.viewport.x - var top = trace.viewport.y - var iw = w / m - var ih = h / m - - trace.passes = [] - - for (var i$2 = 0; i$2 < m; i$2++) { - for (var j = 0; j < m; j++) { - if (!trace.diagonal && j === i$2) { continue } - if (!trace.upper && i$2 > j) { continue } - if (!trace.lower && i$2 < j) { continue } - - var key = passId(trace.id, i$2, j) - - var pass = this.passes[key] || (this.passes[key] = {}) - - if (o.data) { - if (o.transpose) { - pass.positions = { - x: {buffer: trace.buffer, offset: j, count: n, stride: m}, - y: {buffer: trace.buffer, offset: i$2, count: n, stride: m} - } - } - else { - pass.positions = { - x: {buffer: trace.buffer, offset: j * n, count: n}, - y: {buffer: trace.buffer, offset: i$2 * n, count: n} - } - } - - pass.bounds = getBox(trace.bounds, i$2, j) - } - - if (o.domain || o.viewport || o.data) { - var pad = multipadding ? getBox(trace.padding, i$2, j) : trace.padding - if (trace.domain) { + var regl = ref.regl; + + // remove pass if null + if (options === null) { + this.traces[i] = null + return this + } + + if (!options) { return this } + + var o = pick(options, { + data: 'data items columns rows values dimensions samples x', + snap: 'snap cluster', + size: 'sizes size radius', + color: 'colors color fill fill-color fillColor', + opacity: 'opacity alpha transparency opaque', + borderSize: 'borderSizes borderSize border-size bordersize borderWidth borderWidths border-width borderwidth stroke-width strokeWidth strokewidth outline', + borderColor: 'borderColors borderColor bordercolor stroke stroke-color strokeColor', + marker: 'markers marker shape', + range: 'range ranges databox dataBox', + viewport: 'viewport viewBox viewbox', + domain: 'domain domains area areas', + padding: 'pad padding paddings pads margin margins', + transpose: 'transpose transposed', + diagonal: 'diagonal diag showDiagonal', + upper: 'upper up top upperhalf upperHalf showupperhalf showUpper showUpperHalf', + lower: 'lower low bottom lowerhalf lowerHalf showlowerhalf showLowerHalf showLower' + }) + + // we provide regl buffer per-trace, since trace data can be changed + var trace = (this.traces[i] || (this.traces[i] = { + id: i, + buffer: regl.buffer({ + usage: 'dynamic', + type: 'float', + data: new Uint8Array() + }), + color: 'black', + marker: null, + size: 12, + borderColor: 'transparent', + borderSize: 1, + viewport: rect([regl._gl.drawingBufferWidth, regl._gl.drawingBufferHeight]), + padding: [0, 0, 0, 0], + opacity: 1, + diagonal: true, + upper: true, + lower: true + })) + + + // save styles + if (o.color != null) { + trace.color = o.color + } + if (o.size != null) { + trace.size = o.size + } + if (o.marker != null) { + trace.marker = o.marker + } + if (o.borderColor != null) { + trace.borderColor = o.borderColor + } + if (o.borderSize != null) { + trace.borderSize = o.borderSize + } + if (o.opacity != null) { + trace.opacity = o.opacity + } + if (o.viewport) { + trace.viewport = rect(o.viewport) + } + if (o.diagonal != null) { trace.diagonal = o.diagonal } + if (o.upper != null) { trace.upper = o.upper } + if (o.lower != null) { trace.lower = o.lower } + + // put flattened data into buffer + if (o.data) { + trace.buffer(flatten(o.data)) + trace.columns = o.data.length + trace.count = o.data[0].length + + // detect bounds per-column + trace.bounds = [] + + for (var i$1 = 0; i$1 < trace.columns; i$1++) { + trace.bounds[i$1] = getBounds(o.data[i$1], 1) + } + } + + // add proper range updating markers + var multirange + if (o.range) { + trace.range = o.range + multirange = trace.range && typeof trace.range[0] !== 'number' + } + + if (o.domain) { + trace.domain = o.domain + } + var multipadding = false + if (o.padding != null) { + // multiple paddings + if (Array.isArray(o.padding) && o.padding.length === trace.columns && typeof o.padding[o.padding.length - 1] === 'number') { + trace.padding = o.padding.map(getPad) + multipadding = true + } + // single padding + else { + trace.padding = getPad(o.padding) + } + } + + // create passes + var m = trace.columns + var n = trace.count + + var w = trace.viewport.width + var h = trace.viewport.height + var left = trace.viewport.x + var top = trace.viewport.y + var iw = w / m + var ih = h / m + + trace.passes = [] + + for (var i$2 = 0; i$2 < m; i$2++) { + for (var j = 0; j < m; j++) { + if (!trace.diagonal && j === i$2) { continue } + if (!trace.upper && i$2 > j) { continue } + if (!trace.lower && i$2 < j) { continue } + + var key = passId(trace.id, i$2, j) + + var pass = this.passes[key] || (this.passes[key] = {}) + + if (o.data) { + if (o.transpose) { + pass.positions = { + x: {buffer: trace.buffer, offset: j, count: n, stride: m}, + y: {buffer: trace.buffer, offset: i$2, count: n, stride: m} + } + } + else { + pass.positions = { + x: {buffer: trace.buffer, offset: j * n, count: n}, + y: {buffer: trace.buffer, offset: i$2 * n, count: n} + } + } + + pass.bounds = getBox(trace.bounds, i$2, j) + } + + if (o.domain || o.viewport || o.data) { + var pad = multipadding ? getBox(trace.padding, i$2, j) : trace.padding + if (trace.domain) { var ref$1 = getBox(trace.domain, i$2, j); var lox = ref$1[0]; var loy = ref$1[1]; var hix = ref$1[2]; - var hiy = ref$1[3]; - - pass.viewport = [ - left + lox * w + pad[0], - top + loy * h + pad[1], - left + hix * w - pad[2], - top + hiy * h - pad[3] - ] - } - // consider auto-domain equipartial - else { - pass.viewport = [ - left + j * iw + iw * pad[0], - top + i$2 * ih + ih * pad[1], - left + (j + 1) * iw - iw * pad[2], - top + (i$2 + 1) * ih - ih * pad[3] - ] - } - } - - if (o.color) { pass.color = trace.color } - if (o.size) { pass.size = trace.size } - if (o.marker) { pass.marker = trace.marker } - if (o.borderSize) { pass.borderSize = trace.borderSize } - if (o.borderColor) { pass.borderColor = trace.borderColor } - if (o.opacity) { pass.opacity = trace.opacity } - - if (o.range) { - pass.range = multirange ? getBox(trace.range, i$2, j) : trace.range || pass.bounds - } - - trace.passes.push(key) - } - } - - return this -} - - -// draw all or passed passes + var hiy = ref$1[3]; + + pass.viewport = [ + left + lox * w + pad[0], + top + loy * h + pad[1], + left + hix * w - pad[2], + top + hiy * h - pad[3] + ] + } + // consider auto-domain equipartial + else { + pass.viewport = [ + left + j * iw + iw * pad[0], + top + i$2 * ih + ih * pad[1], + left + (j + 1) * iw - iw * pad[2], + top + (i$2 + 1) * ih - ih * pad[3] + ] + } + } + + if (o.color) { pass.color = trace.color } + if (o.size) { pass.size = trace.size } + if (o.marker) { pass.marker = trace.marker } + if (o.borderSize) { pass.borderSize = trace.borderSize } + if (o.borderColor) { pass.borderColor = trace.borderColor } + if (o.opacity) { pass.opacity = trace.opacity } + + if (o.range) { + pass.range = multirange ? getBox(trace.range, i$2, j) : trace.range || pass.bounds + } + + trace.passes.push(key) + } + } + + return this +} + + +// draw all or passed passes SPLOM.prototype.draw = function () { var ref$2; var args = [], len = arguments.length; - while ( len-- ) args[ len ] = arguments[ len ]; - if (!args.length) { - this.scatter.draw() - } - else { - var idx = [] - for (var i = 0; i < args.length; i++) { - // draw(0, 2, 5) - draw traces - if (typeof args[i] === 'number' ) { + while ( len-- ) args[ len ] = arguments[ len ]; + if (!args.length) { + this.scatter.draw() + } + else { + var idx = [] + for (var i = 0; i < args.length; i++) { + // draw(0, 2, 5) - draw traces + if (typeof args[i] === 'number' ) { var ref = this.traces[args[i]]; var passes = ref.passes; - var passOffset = ref.passOffset; - idx.push.apply(idx, arrRange(passOffset, passOffset + passes.length)) - } - // draw([0, 1, 2 ...], [3, 4, 5]) - draw points - else if (args[i].length) { - var els = args[i] + var passOffset = ref.passOffset; + idx.push.apply(idx, arrRange(passOffset, passOffset + passes.length)) + } + // draw([0, 1, 2 ...], [3, 4, 5]) - draw points + else if (args[i].length) { + var els = args[i] var ref$1 = this.traces[i]; var passes$1 = ref$1.passes; - var passOffset$1 = ref$1.passOffset; - passes$1 = passes$1.map(function (passId, i) { - idx[passOffset$1 + i] = els - }) - } - } - (ref$2 = this.scatter).draw.apply(ref$2, idx) - } - - return this -} - - -// dispose resources -SPLOM.prototype.destroy = function () { - this.traces.forEach(function (trace) { - if (trace.buffer && trace.buffer.destroy) { trace.buffer.destroy() } - }) - this.traces = null - this.passes = null - - this.scatter.destroy() - - return this -} - - -// return pass corresponding to trace i- j- square -function passId (trace, i, j) { - var id = (trace.id != null ? trace.id : trace) - var n = i - var m = j - var key = id << 16 | (n & 0xff) << 8 | m & 0xff - - return key -} - - -// return bounding box corresponding to a pass -function getBox (items, i, j) { - var ilox, iloy, ihix, ihiy, jlox, jloy, jhix, jhiy - var iitem = items[i], jitem = items[j] - - if (iitem.length > 2) { - ilox = iitem[0] - ihix = iitem[2] - iloy = iitem[1] - ihiy = iitem[3] - } - else if (iitem.length) { - ilox = iloy = iitem[0] - ihix = ihiy = iitem[1] - } - else { - ilox = iitem.x - iloy = iitem.y - ihix = iitem.x + iitem.width - ihiy = iitem.y + iitem.height - } - - if (jitem.length > 2) { - jlox = jitem[0] - jhix = jitem[2] - jloy = jitem[1] - jhiy = jitem[3] - } - else if (jitem.length) { - jlox = jloy = jitem[0] - jhix = jhiy = jitem[1] - } - else { - jlox = jitem.x - jloy = jitem.y - jhix = jitem.x + jitem.width - jhiy = jitem.y + jitem.height - } - - return [ jlox, iloy, jhix, ihiy ] -} - - -function getPad (arg) { - if (typeof arg === 'number') { return [arg, arg, arg, arg] } - else if (arg.length === 2) { return [arg[0], arg[1], arg[0], arg[1]] } - else { - var box = rect(arg) - return [box.x, box.y, box.x + box.width, box.y + box.height] - } -} + var passOffset$1 = ref$1.passOffset; + passes$1 = passes$1.map(function (passId, i) { + idx[passOffset$1 + i] = els + }) + } + } + (ref$2 = this.scatter).draw.apply(ref$2, idx) + } + + return this +} + + +// dispose resources +SPLOM.prototype.destroy = function () { + this.traces.forEach(function (trace) { + if (trace.buffer && trace.buffer.destroy) { trace.buffer.destroy() } + }) + this.traces = null + this.passes = null + + this.scatter.destroy() + + return this +} + + +// return pass corresponding to trace i- j- square +function passId (trace, i, j) { + var id = (trace.id != null ? trace.id : trace) + var n = i + var m = j + var key = id << 16 | (n & 0xff) << 8 | m & 0xff + + return key +} + + +// return bounding box corresponding to a pass +function getBox (items, i, j) { + var ilox, iloy, ihix, ihiy, jlox, jloy, jhix, jhiy + var iitem = items[i], jitem = items[j] + + if (iitem.length > 2) { + ilox = iitem[0] + ihix = iitem[2] + iloy = iitem[1] + ihiy = iitem[3] + } + else if (iitem.length) { + ilox = iloy = iitem[0] + ihix = ihiy = iitem[1] + } + else { + ilox = iitem.x + iloy = iitem.y + ihix = iitem.x + iitem.width + ihiy = iitem.y + iitem.height + } + + if (jitem.length > 2) { + jlox = jitem[0] + jhix = jitem[2] + jloy = jitem[1] + jhiy = jitem[3] + } + else if (jitem.length) { + jlox = jloy = jitem[0] + jhix = jhiy = jitem[1] + } + else { + jlox = jitem.x + jloy = jitem.y + jhix = jitem.x + jitem.width + jhiy = jitem.y + jitem.height + } + + return [ jlox, iloy, jhix, ihiy ] +} + + +function getPad (arg) { + if (typeof arg === 'number') { return [arg, arg, arg, arg] } + else if (arg.length === 2) { return [arg[0], arg[1], arg[0], arg[1]] } + else { + var box = rect(arg) + return [box.x, box.y, box.x + box.width, box.y + box.height] + } +} },{"array-bounds":68,"array-range":70,"flatten-vertex-data":239,"parse-rect":457,"pick-by-alias":463,"raf":482,"regl-scatter2d":490}],492:[function(_dereq_,module,exports){ (function(ja,N){"object"===typeof exports&&"undefined"!==typeof module?module.exports=N():"function"===typeof define&&define.amd?define(N):ja.createREGL=N()})(this,function(){function ja(a,b){this.id=Bb++;this.type=a;this.data=b}function N(a){if(0===a.length)return[];var b=a.charAt(0),c=a.charAt(a.length-1);if(1>1; i>=0; --i) { heapDown(i) } - + //Kill vertices while(true) { var hmin = heapPop() @@ -72380,62 +72380,62 @@ function negative(points, plane) { }(); // eslint-disable-line },{}],520:[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":456}],521:[function(_dereq_,module,exports){ "use strict" @@ -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 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":63,"assert":71,"is-svg-path":424,"normalize-svg-path":525,"parse-svg-path":458}],525:[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":523}],526:[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":96,"draw-svg-path":169,"is-svg-path":424,"parse-svg-path":458,"svg-path-bounds":524}],527:[function(_dereq_,module,exports){ (function (process){ @@ -74519,45 +74519,45 @@ else { })(Math); },{}],529:[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] +} },{}],530:[function(_dereq_,module,exports){ 'use strict' @@ -74587,7 +74587,7 @@ function toPX(str, element) { element = element || document.body str = (str || 'px').trim().toLowerCase() if(element === window || element === document) { - element = document.body + element = document.body } switch(str) { case '%': //Ambiguous, not sure if we should use width or height @@ -75309,7 +75309,7 @@ proto.recalcMatrix = function(t) { var center = this.computedCenter - var wx = ctheta * cphi + var wx = ctheta * cphi var wy = stheta * cphi var wz = sphi @@ -75450,12 +75450,12 @@ proto.translate = function(t, dx, dy, dz) { //Recenters the coordinate axes proto.setMatrix = function(t, mat, axes, noSnap) { - + //Get the axes for tare var ushift = 1 if(typeof axes === 'number') { ushift = (axes)|0 - } + } if(ushift < 0 || ushift > 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 @@ -76059,11 +76059,11 @@ exports.freeInt8 = exports.freeInt16 = exports.freeInt32 = exports.freeBigInt64 = -exports.freeFloat32 = +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,142 +94100,142 @@ 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: { valType: 'string', dflt: '', - + editType: 'legend', - + }, font: fontAttrs({ editType: 'legend', - + }), side: { valType: 'enumerated', values: ['top', 'left', 'top left'], - + editType: 'legend', - + }, editType: 'legend', }, @@ -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,38 +99356,38 @@ 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', values: ['evenodd', 'nonzero'], dflt: 'evenodd', - + editType: 'arraydraw', - + }, editable: { valType: 'boolean', - + dflt: false, editType: 'calc+arraydraw', - + }, editType: 'arraydraw' @@ -100482,63 +100482,63 @@ module.exports = { color: { valType: 'color', editType: 'none', - - + + }, width: { valType: 'number', min: 0, dflt: 4, - + editType: 'none', - + }, dash: extendFlat({}, dash, { dflt: 'solid', editType: 'none' }), - + editType: 'none' }, fillcolor: { valType: 'color', dflt: 'rgba(0,0,0,0)', - + editType: 'none', - + }, fillrule: { valType: 'enumerated', values: ['evenodd', 'nonzero'], dflt: 'evenodd', - + editType: 'none', - + }, opacity: { valType: 'number', min: 0, max: 1, dflt: 1, - + editType: 'none', - + }, layer: { valType: 'enumerated', values: ['below', 'above'], dflt: 'above', - + editType: 'none', - + }, drawdirection: { valType: 'enumerated', - + values: ['ortho', 'horizontal', 'vertical', 'diagonal'], dflt: 'diagonal', editType: 'none', - + }, editType: 'none' @@ -100548,18 +100548,18 @@ module.exports = { fillcolor: { valType: 'color', dflt: 'rgb(255,0,255)', - + editType: 'none', - + }, opacity: { valType: 'number', min: 0, max: 1, dflt: 0.5, - + editType: 'none', - + }, editType: 'none' } @@ -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,49 +103081,49 @@ 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', - + freeLength: true, items: [ {valType: 'any'}, {valType: 'any'}, {valType: 'any'} ], - + }, 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: { @@ -117820,32 +117823,32 @@ var configAttributes = { min: 0, max: 2, dflt: 0, - + }, queueLength: { 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,34 +128260,34 @@ 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', - + min: 0, editType: 'ticks', - + }, editType: 'ticks' }, @@ -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,58 +128385,58 @@ module.exports = { constants.idRegex.x.toString(), constants.idRegex.y.toString() ], - + editType: 'calc', - + }, rangebreaks: templatedArray('rangebreak', { enabled: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, bounds: { valType: 'info_array', - + items: [ {valType: 'any', editType: 'calc'}, {valType: 'any', editType: 'calc'} ], editType: 'calc', - + }, pattern: { valType: 'enumerated', values: [DAY_OF_WEEK, HOUR, ''], - + editType: 'calc', - + }, values: { valType: 'info_array', freeLength: true, - + editType: 'calc', items: { valType: 'any', editType: 'calc' }, - + }, dvalue: { // TODO could become 'any' to add support for 'months', 'years' valType: 'number', - + editType: 'calc', min: 0, dflt: ONEDAY, - + }, /* @@ -128429,16 +128445,16 @@ module.exports = { min: 0, dflt: 0, // for *date* axes, maybe something else for *linear* editType: 'calc', - - + + }, gapmode: { valType: 'enumerated', values: ['pixels', 'fraction'], dflt: 'pixels', editType: 'calc', - - + + }, */ @@ -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,265 +133794,265 @@ 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: { valType: 'enumerated', values: [false, 'locations', 'geojson'], dflt: false, - + editType: 'plot', - + }, 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: { valType: 'boolean', - + dflt: true, - + }, 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' }, @@ -139053,201 +139069,201 @@ module.exports = { valType: 'enumerated', values: [false, 'hide', 'show'], dflt: false, - + editType: 'plot', - + }, minsize: { valType: 'number', min: 0, dflt: 0, - + editType: 'plot', - + }, editType: 'plot' }, 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', - + }, editType: 'plot' }, 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'); @@ -149182,10 +149198,10 @@ exports.hovertemplateAttrs = function(opts, extra) { var hovertemplate = { valType: 'string', - + dflt: '', editType: opts.editType || 'none', - + }; if(opts.arrayOk !== false) { @@ -149203,10 +149219,10 @@ exports.texttemplateAttrs = function(opts, extra) { var texttemplate = { valType: 'string', - + dflt: '', editType: opts.editType || 'calc', - + }; if(opts.arrayOk !== false) { @@ -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,97 +155170,97 @@ 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: { valType: 'number', - + editType: 'calc', - + }, dy: { valType: 'number', - + editType: 'calc', - + }, name: { valType: 'string', - + editType: 'calc+clearAxisTypes', - + }, q1: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, median: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, q3: { valType: 'data_array', - + editType: 'calc+clearAxisTypes', - + }, lowerfence: { valType: 'data_array', - + editType: 'calc', - + }, 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', - + editType: 'calc', - + }, // TODO @@ -155255,80 +155271,80 @@ 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: { valType: 'enumerated', values: [true, 'sd', false], - + editType: 'calc', - + }, mean: { valType: 'data_array', - + editType: 'calc', - + }, sd: { valType: 'data_array', - + editType: 'calc', - + }, orientation: { valType: 'enumerated', values: ['v', 'h'], - + editType: 'calc+clearAxisTypes', - + }, quartilemethod: { valType: 'enumerated', values: ['linear', 'exclusive', 'inclusive'], dflt: 'linear', - + editType: 'calc', - + }, 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' }, @@ -155389,9 +155405,9 @@ module.exports = { min: 0, max: 1, dflt: 0.5, - + editType: 'calc', - + }, offsetgroup: barAttrs.offsetgroup, @@ -155407,22 +155423,22 @@ module.exports = { }, text: extendFlat({}, scatterAttrs.text, { - + }), hovertext: extendFlat({}, scatterAttrs.hovertext, { - + }), hovertemplate: hovertemplateAttrs({ - + }), hoveron: { 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,24 +160983,24 @@ module.exports = extendFlat({ locations: { valType: 'data_array', editType: 'calc', - + }, locationmode: scatterGeoAttrs.locationmode, z: { valType: 'data_array', editType: 'calc', - + }, geojson: extendFlat({}, scatterGeoAttrs.geojson, { - + }), 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,12 +161551,12 @@ module.exports = extendFlat({ geojson: { valType: 'any', - + editType: 'calc', - + }, featureidkey: extendFlat({}, choroplethAttrs.featureidkey, { - + }), // TODO agree on name / behaviour @@ -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: { - + } }; @@ -162487,35 +162503,35 @@ module.exports = extendFlat({ hovertemplate: heatmapAttrs.hovertemplate, hoverongaps: heatmapAttrs.hoverongaps, connectgaps: extendFlat({}, heatmapAttrs.connectgaps, { - + }), 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,18 +162624,18 @@ module.exports = extendFlat({ line: { color: extendFlat({}, scatterLineAttrs.color, { editType: 'style+colorbars', - + }), width: { valType: 'number', min: 0, - + editType: 'style+colorbars', - + }, 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,77 +167709,77 @@ 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', dflt: true, - + editType: 'none', - + }, 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: { - - + + } }; @@ -171515,7 +171531,7 @@ module.exports = extendFlat({ color: contourAttrs.line.color, width: extendFlat({}, contourAttrs.line.width, { dflt: 0.5, - + }), dash: contourAttrs.line.dash, smoothing: contourAttrs.line.smoothing, @@ -171594,8 +171610,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', '2dMap', 'contour', 'histogram', 'showLegend'], meta: { - - + + } }; @@ -171626,17 +171642,17 @@ for(var i = 0; i < cm.length; i++) { module.exports = extendFlat({ z: { valType: 'data_array', - + editType: 'calc', - + }, colormodel: { valType: 'enumerated', values: cm, dflt: 'rgb', - + editType: 'calc', - + }, zmin: { valType: 'info_array', @@ -171646,9 +171662,9 @@ module.exports = extendFlat({ {valType: 'number', editType: 'calc'}, {valType: 'number', editType: 'calc'} ], - + editType: 'calc', - + }, zmax: { valType: 'info_array', @@ -171658,47 +171674,47 @@ module.exports = extendFlat({ {valType: 'number', editType: 'calc'}, {valType: 'number', editType: 'calc'} ], - + editType: 'calc', - + }, x0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', - + }, y0: { valType: 'any', dflt: 0, - + editType: 'calc+clearAxisTypes', - + }, dx: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, dy: { valType: 'number', dflt: 1, - + editType: 'calc', - + }, text: { valType: 'data_array', editType: 'plot', - + }, hovertext: { valType: 'data_array', editType: 'plot', - + }, hoverinfo: extendFlat({}, baseAttrs.hoverinfo, { flags: ['x', 'y', 'z', 'color', 'name', 'text'], @@ -172029,7 +172045,7 @@ module.exports = { categories: ['cartesian', 'svg', '2dMap', 'noSortingByValue'], animatable: false, 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,104 +175153,104 @@ 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', values: ['vertex', 'cell'], dflt: 'vertex', editType: 'calc', - - + + }, // 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,48 +182137,48 @@ module.exports = { }), textposition: { valType: 'enumerated', - + values: ['inside', 'outside', 'auto', 'none'], dflt: 'auto', arrayOk: true, editType: 'plot', - + }, textfont: extendFlat({}, textFontAttrs, { - + }), insidetextorientation: { valType: 'enumerated', - + values: ['horizontal', 'radial', 'tangential', 'auto'], dflt: 'auto', editType: 'plot', - + }, insidetextfont: extendFlat({}, textFontAttrs, { - + }), outsidetextfont: extendFlat({}, textFontAttrs, { - + }), automargin: { valType: 'boolean', dflt: false, - + editType: 'plot', - + }, title: { 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,47 +184497,47 @@ 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', editType: 'calc', - + }, line: { color: { valType: 'color', - + dflt: colorAttrs.defaultLine, arrayOk: true, - + }, width: { valType: 'number', - + min: 0, dflt: 0.5, arrayOk: true, - + } }, pad: { @@ -184529,124 +184545,132 @@ 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: { + valType: 'data_array', + dflt: [], + }, + }, link: { label: { valType: 'data_array', dflt: [], - - + + }, color: { valType: 'color', - + arrayOk: true, - + }, customdata: { valType: 'data_array', editType: 'calc', - + }, 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', + dflt: [], }, hoverinfo: { 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; @@ -185059,6 +185083,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; @@ -185082,6 +185107,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'); @@ -185151,7 +185177,7 @@ module.exports = { selectPoints: _dereq_('./select.js'), categories: ['noOpacity'], meta: { - + } }; @@ -185826,6 +185852,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, @@ -186013,6 +186040,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, @@ -186549,6 +186577,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); @@ -186583,7 +186650,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 @@ -186709,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({}, { @@ -186795,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 @@ -186822,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' }, @@ -186867,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: { @@ -186899,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({ @@ -186960,10 +187037,10 @@ module.exports = { valType: 'number', min: 0, arrayOk: true, - + editType: 'style', anim: true, - + }, editType: 'calc' }, @@ -186975,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' }, @@ -186998,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' }, @@ -187034,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' }, @@ -187074,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', - + } }; @@ -188132,7 +188209,7 @@ module.exports = { 'zoomScale' ], meta: { - + } }; @@ -189814,8 +189891,8 @@ var lineAttrs = extendFlat({ valType: 'enumerated', values: Object.keys(DASHES), dflt: 'solid', - - + + } }, colorAttributes('line')); @@ -189823,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, - + } }; } @@ -189851,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(), @@ -189869,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'), @@ -189892,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, @@ -189903,7 +189980,7 @@ var attrs = module.exports = overrideAll({ sizemode: scatterMarkerAttrs.sizemode, opacity: extendFlat({}, scatterMarkerAttrs.opacity, { arrayOk: false, - + }), colorbar: scatterMarkerAttrs.colorbar, @@ -190708,8 +190785,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -190739,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, @@ -190776,7 +190853,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, marker: extendFlat({ @@ -191129,8 +191206,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['svg', 'carpet', 'symbols', 'showLegend', 'carpetDependent', 'zoomScale'], meta: { - - + + } }; @@ -191206,49 +191283,49 @@ 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: { valType: 'any', - + editType: 'calc', - + }, featureidkey: { valType: 'string', - + editType: 'calc', dflt: 'id', - + }, 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, @@ -191283,8 +191360,8 @@ module.exports = overrideAll({ valType: 'enumerated', values: ['none', 'toself'], dflt: 'none', - - + + }, fillcolor: scatterAttrs.fillcolor, @@ -191642,8 +191719,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/geo'), categories: ['geo', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -191923,8 +192000,8 @@ var attrs = module.exports = overrideAll({ valType: 'flaglist', flags: ['lines', 'markers', 'text'], extras: ['none'], - - + + }, line: { color: scatterLineAttrs.color, @@ -191933,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'), { @@ -193245,8 +193322,8 @@ module.exports = { selectPoints: _dereq_('./select'), meta: { - - + + } }; @@ -193890,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: { @@ -193917,22 +193994,22 @@ module.exports = overrideAll({ symbol: { valType: 'string', dflt: 'circle', - + arrayOk: true, - + }, angle: { valType: 'number', dflt: 'auto', - + arrayOk: true, - + }, allowoverlap: { valType: 'boolean', dflt: false, - - + + }, opacity: markerAttrs.opacity, size: markerAttrs.size, @@ -193952,8 +194029,8 @@ module.exports = overrideAll({ below: { valType: 'string', - - + + }, selected: { @@ -194574,8 +194651,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/mapbox'), categories: ['mapbox', 'gl', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -194791,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, @@ -194865,7 +194942,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, @@ -195193,8 +195270,8 @@ module.exports = { selectPoints: _dereq_('../scatter/select'), meta: { - - + + } }; @@ -195511,8 +195588,8 @@ module.exports = { selectPoints: _dereq_('../scattergl/select'), meta: { - - + + } }; @@ -195682,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, @@ -195726,7 +195803,7 @@ module.exports = { fill: extendFlat({}, scatterAttrs.fill, { values: ['none', 'toself', 'tonext'], dflt: 'none', - + }), fillcolor: scatterAttrs.fillcolor, marker: extendFlat({ @@ -196106,8 +196183,8 @@ module.exports = { basePlotModule: _dereq_('../../plots/ternary'), categories: ['ternary', 'symbols', 'showLegend', 'scatter-like'], meta: { - - + + } }; @@ -196189,14 +196266,14 @@ function makeAxesValObject(axLetter) { return { valType: 'info_array', freeLength: true, - + editType: 'calc', items: { valType: 'subplotid', regex: cartesianIdRegex[axLetter], editType: 'plot' }, - + }; } @@ -196204,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' @@ -196255,10 +196332,10 @@ module.exports = { // mode: {}, (only 'markers' for now) text: extendFlat({}, scatterGlAttrs.text, { - + }), hovertext: extendFlat({}, scatterGlAttrs.hovertext, { - + }), hovertemplate: hovertemplateAttrs(), @@ -196271,10 +196348,10 @@ module.exports = { diagonal: { visible: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, // type: 'scattergl' | 'histogram' | 'box' | 'violin' @@ -196286,17 +196363,17 @@ module.exports = { showupperhalf: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, showlowerhalf: { valType: 'boolean', - + dflt: true, editType: 'calc', - + }, selected: { @@ -196967,7 +197044,7 @@ module.exports = { editStyle: _dereq_('./edit_style'), meta: { - + } }; @@ -197288,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' }, @@ -197344,9 +197421,9 @@ var attrs = { valType: 'integer', min: 0, dflt: 1000, - + editType: 'calc', - + }, // TODO @@ -197361,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: [ @@ -198013,7 +198090,7 @@ module.exports = { }, meta: { - + } }; @@ -198042,26 +198119,26 @@ module.exports = { labels: { valType: 'data_array', editType: 'calc', - + }, parents: { valType: 'data_array', editType: 'calc', - + }, values: { valType: 'data_array', editType: 'calc', - + }, branchvalues: { valType: 'enumerated', values: ['remainder', 'total'], dflt: 'remainder', editType: 'calc', - - + + }, count: { valType: 'flaglist', @@ -198071,30 +198148,30 @@ 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: { @@ -198105,7 +198182,7 @@ module.exports = { line: { color: extendFlat({}, pieAttrs.marker.line.color, { dflt: null, - + }), width: extendFlat({}, pieAttrs.marker.line.width, {dflt: 1}), editType: 'calc' @@ -198122,10 +198199,10 @@ module.exports = { opacity: { valType: 'number', editType: 'style', - + min: 0, max: 1, - + }, editType: 'plot' }, @@ -198133,7 +198210,7 @@ module.exports = { text: pieAttrs.text, textinfo: { valType: 'flaglist', - + flags: [ 'label', 'text', @@ -198145,7 +198222,7 @@ module.exports = { ], extras: ['none'], editType: 'plot', - + }, // TODO: incorporate `label` and `value` in the eventData @@ -198175,7 +198252,7 @@ module.exports = { insidetextorientation: pieAttrs.insidetextorientation, insidetextfont: pieAttrs.insidetextfont, outsidetextfont: extendFlat({}, pieAttrs.outsidetextfont, { - + }), domain: domainAttrs({name: 'sunburst', trace: true, editType: 'calc'}) @@ -199158,7 +199235,7 @@ module.exports = { colorbar: _dereq_('../scatter/marker_colorbar'), meta: { - + } }; @@ -199176,16 +199253,16 @@ module.exports = { module.exports = { sunburstcolorway: { valType: 'colorlist', - + editType: 'calc', - + }, extendsunburstcolors: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }; @@ -199915,9 +199992,9 @@ var overrideAll = _dereq_('../../plot_api/edit_types').overrideAll; function makeContourProjAttr(axLetter) { return { valType: 'boolean', - + dflt: false, - + }; } @@ -199925,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'), @@ -199961,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, - + } }; } @@ -200005,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', - + }, }, @@ -200059,106 +200136,106 @@ 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: { valType: 'any', - + editType: 'calc', - + }, _deprecated: { zauto: extendFlat({}, colorScaleAttrs.zauto, { - + }), zmin: extendFlat({}, colorScaleAttrs.zmin, { - + }), zmax: extendFlat({}, colorScaleAttrs.zmax, { - + }) }, @@ -201106,7 +201183,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', '2dMap', 'showLegend'], meta: { - + } }; @@ -201136,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}), @@ -201192,13 +201269,13 @@ var attrs = module.exports = overrideAll({ valType: 'number', arrayOk: true, dflt: 1, - + }, color: { valType: 'color', arrayOk: true, dflt: 'grey', - + } }, @@ -201207,8 +201284,8 @@ var attrs = module.exports = overrideAll({ valType: 'color', arrayOk: true, dflt: 'white', - - + + } }, @@ -201219,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}), @@ -201261,13 +201338,13 @@ var attrs = module.exports = overrideAll({ valType: 'number', arrayOk: true, dflt: 1, - + }, color: { valType: 'color', arrayOk: true, dflt: 'grey', - + } }, @@ -201275,9 +201352,9 @@ var attrs = module.exports = overrideAll({ color: { valType: 'color', arrayOk: true, - + dflt: 'white', - + } }, @@ -201762,7 +201839,7 @@ module.exports = { basePlotModule: _dereq_('./base_plot'), categories: ['noOpacity'], meta: { - + } }; @@ -202705,39 +202782,39 @@ module.exports = { 'dice-slice' ], dflt: 'squarify', - + editType: 'plot', - + }, squarifyratio: { valType: 'number', - + min: 1, dflt: 1, editType: 'plot', - + }, flip: { valType: 'flaglist', - + flags: [ 'x', 'y' ], dflt: '', editType: 'plot', - + }, pad: { valType: 'number', - + min: 0, dflt: 3, editType: 'plot', - + }, editType: 'calc', @@ -202747,31 +202824,31 @@ module.exports = { pad: { t: { valType: 'number', - + min: 0, editType: 'plot', - + }, l: { valType: 'number', - + min: 0, editType: 'plot', - + }, r: { valType: 'number', - + min: 0, editType: 'plot', - + }, b: { valType: 'number', - + min: 0, editType: 'plot', - + }, editType: 'calc' @@ -202783,8 +202860,8 @@ module.exports = { valType: 'enumerated', values: [true, false, 'reversed'], editType: 'style', - - + + }, line: sunburstAttrs.marker.line, @@ -202801,9 +202878,9 @@ module.exports = { visible: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, side: { @@ -202813,9 +202890,9 @@ module.exports = { 'bottom' ], dflt: 'top', - + editType: 'plot', - + }, edgeshape: { @@ -202828,21 +202905,21 @@ module.exports = { '\\' ], dflt: '>', - + editType: 'plot', - + }, thickness: { valType: 'number', min: 12, - + editType: 'plot', - + }, textfont: extendFlat({}, pieAttrs.textfont, { - + }), editType: 'calc' @@ -202864,7 +202941,7 @@ module.exports = { textfont: pieAttrs.textfont, insidetextfont: pieAttrs.insidetextfont, outsidetextfont: extendFlat({}, pieAttrs.outsidetextfont, { - + }), textposition: { @@ -202875,9 +202952,9 @@ module.exports = { 'bottom left', 'bottom center', 'bottom right' ], dflt: 'top left', - + editType: 'plot', - + }, domain: domainAttrs({name: 'treemap', trace: true, editType: 'calc'}), @@ -203496,7 +203573,7 @@ module.exports = { colorbar: _dereq_('../scatter/marker_colorbar'), meta: { - + } }; @@ -203514,16 +203591,16 @@ module.exports = { module.exports = { treemapcolorway: { valType: 'colorlist', - + editType: 'calc', - + }, extendtreemapcolors: { valType: 'boolean', dflt: true, - + editType: 'calc', - + } }; @@ -204412,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', @@ -204456,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, @@ -204503,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' }, @@ -204545,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' }, @@ -204569,9 +204646,9 @@ module.exports = { valType: 'enumerated', values: ['both', 'positive', 'negative'], dflt: 'both', - + editType: 'calc', - + }, offsetgroup: boxAttrs.offsetgroup, @@ -204585,9 +204662,9 @@ module.exports = { flags: ['violins', 'points', 'kde'], dflt: 'violins+points+kde', extras: ['all'], - + editType: 'style', - + } }; @@ -205086,7 +205163,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'violinLayout', 'zoomScale'], meta: { - + } }; @@ -205106,13 +205183,13 @@ var extendFlat = _dereq_('../../lib').extendFlat; module.exports = { violinmode: extendFlat({}, boxLayoutAttrs.boxmode, { - + }), violingap: extendFlat({}, boxLayoutAttrs.boxgap, { - + }), violingroupgap: extendFlat({}, boxLayoutAttrs.boxgroupgap, { - + }) }; @@ -205413,17 +205490,17 @@ var attrs = module.exports = overrideAll(extendFlat({ spaceframe: { show: { valType: 'boolean', - + dflt: false, - + }, fill: { valType: 'number', - + min: 0, max: 1, dflt: 1, - + } }, @@ -205641,7 +205718,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/gl3d'), categories: ['gl3d', 'showLegend'], meta: { - + } }; @@ -205671,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', }, @@ -205696,18 +205773,18 @@ module.exports = { measure: { valType: 'data_array', dflt: [], - + editType: 'calc', - + }, base: { valType: 'number', dflt: null, arrayOk: false, - + editType: 'calc', - + }, x: barAttrs.x, @@ -205730,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'}, { @@ -205771,16 +205848,16 @@ module.exports = { valType: 'enumerated', values: ['spanning', 'between'], dflt: 'between', - + editType: 'plot', - + }, visible: { valType: 'boolean', dflt: true, - + editType: 'plot', - + }, editType: 'plot' }, @@ -206244,7 +206321,7 @@ module.exports = { basePlotModule: _dereq_('../../plots/cartesian'), categories: ['bar-like', 'cartesian', 'svg', 'oriented', 'showLegend', 'zoomScale'], meta: { - + } }; @@ -206264,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', - + } }; @@ -206541,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 @@ -206553,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' }, @@ -206969,9 +207046,9 @@ exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, target: { valType: 'string', @@ -206979,9 +207056,9 @@ exports.attributes = { noBlank: true, arrayOk: true, dflt: 'x', - + editType: 'calc', - + }, operation: { valType: 'enumerated', @@ -206990,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' }; @@ -207242,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' @@ -207531,9 +207608,9 @@ exports.attributes = { enabled: { valType: 'boolean', dflt: true, - + editType: 'calc', - + }, target: { valType: 'string', @@ -207541,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' }; diff --git a/src/traces/sankey/attributes.js b/src/traces/sankey/attributes.js index 94dd451bc5e..ab437c5a549 100644 --- a/src/traces/sankey/attributes.js +++ b/src/traces/sankey/attributes.js @@ -191,6 +191,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.' }, @@ -272,6 +276,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 9a73591eb12..ff15b50aeb1 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; @@ -68,6 +69,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 031d31ebdb1..22d8d920320 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, @@ -1019,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); @@ -1053,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