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W,IACXC,SAAU,CAAC,GACXC,SAAU,CAAC,IAAK,IAChBC,KAAM,KACNC,MAAO,QACPC,SAAU,SACVC,aAAc,c","sources":["../node_modules/plotly.js/src/lib/nested_property.js","../node_modules/plotly.js/src/lib/noop.js","../node_modules/plotly.js/src/lib/notifier.js","../node_modules/plotly.js/src/lib/override_cursor.js","../node_modules/plotly.js/src/lib/polygon.js","../node_modules/plotly.js/src/lib/preserve_drawing_buffer.js","../node_modules/plotly.js/src/lib/push_unique.js","../node_modules/plotly.js/src/lib/queue.js","../node_modules/plotly.js/src/lib/regex.js","../node_modules/plotly.js/src/lib/relative_attr.js","../node_modules/plotly.js/src/lib/relink_private.js","../node_modules/plotly.js/src/lib/search.js","../node_modules/plotly.js/src/lib/setcursor.js","../node_modules/plotly.js/src/lib/sort_object_keys.js","../node_modules/plotly.js/src/lib/stats.js","../node_modules/plotly.js/src/lib/supports_pixelated_image.js","../node_modules/plotly.js/src/lib/svg_text_utils.js","../node_modules/plotly.js/src/lib/throttle.js","../node_modules/plotly.js/src/lib/to_log_range.js","../node_modules/plotly.js/src/locale-en-us.js","../node_modules/plotly.js/src/locale-en.js"],"sourcesContent":["'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar isArrayOrTypedArray = require('./array').isArrayOrTypedArray;\n\n/**\n * convert a string s (such as 'xaxis.range[0]')\n * representing a property of nested object into set and get methods\n * also return the string and object so we don't have to keep track of them\n * allows [-1] for an array index, to set a property inside all elements\n * of an array\n * eg if obj = {arr: [{a: 1}, {a: 2}]}\n * you can do p = nestedProperty(obj, 'arr[-1].a')\n * but you cannot set the array itself this way, to do that\n * just set the whole array.\n * eg if obj = {arr: [1, 2, 3]}\n * you can't do nestedProperty(obj, 'arr[-1]').set(5)\n * but you can do nestedProperty(obj, 'arr').set([5, 5, 5])\n */\nmodule.exports = function nestedProperty(container, propStr) {\n if(isNumeric(propStr)) propStr = String(propStr);\n else if(typeof propStr !== 'string' ||\n propStr.substr(propStr.length - 4) === '[-1]') {\n throw 'bad property string';\n }\n\n var propParts = propStr.split('.');\n var indexed;\n var indices;\n var i, j;\n\n for(j = 0; j < propParts.length; j++) {\n // guard against polluting __proto__ and other internals\n if(String(propParts[j]).slice(0, 2) === '__') {\n throw 'bad property string';\n }\n }\n\n // check for parts of the nesting hierarchy that are numbers (ie array elements)\n j = 0;\n while(j < propParts.length) {\n // look for non-bracket chars, then any number of [##] blocks\n indexed = String(propParts[j]).match(/^([^\\[\\]]*)((\\[\\-?[0-9]*\\])+)$/);\n if(indexed) {\n if(indexed[1]) propParts[j] = indexed[1];\n // allow propStr to start with bracketed array indices\n else if(j === 0) propParts.splice(0, 1);\n else throw 'bad property string';\n\n indices = indexed[2]\n .substr(1, indexed[2].length - 2)\n .split('][');\n\n for(i = 0; i < indices.length; i++) {\n j++;\n propParts.splice(j, 0, Number(indices[i]));\n }\n }\n j++;\n }\n\n if(typeof container !== 'object') {\n return badContainer(container, propStr, propParts);\n }\n\n return {\n set: npSet(container, propParts, propStr),\n get: npGet(container, propParts),\n astr: propStr,\n parts: propParts,\n obj: container\n };\n};\n\nfunction npGet(cont, parts) {\n return function() {\n var curCont = cont;\n var curPart;\n var allSame;\n var out;\n var i;\n var j;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n if(curPart === -1) {\n allSame = true;\n out = [];\n for(j = 0; j < curCont.length; j++) {\n out[j] = npGet(curCont[j], parts.slice(i + 1))();\n if(out[j] !== out[0]) allSame = false;\n }\n return allSame ? out[0] : out;\n }\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n return undefined;\n }\n curCont = curCont[curPart];\n if(typeof curCont !== 'object' || curCont === null) {\n return undefined;\n }\n }\n\n // only hit this if parts.length === 1\n if(typeof curCont !== 'object' || curCont === null) return undefined;\n\n out = curCont[parts[i]];\n if(out === null) return undefined;\n return out;\n };\n}\n\n/*\n * Can this value be deleted? We can delete `undefined`, and `null` except INSIDE an\n * *args* array.\n *\n * Previously we also deleted some `{}` and `[]`, in order to try and make set/unset\n * a net noop; but this causes far more complication than it's worth, and still had\n * lots of exceptions. See https://github.com/plotly/plotly.js/issues/1410\n *\n * *args* arrays get passed directly to API methods and we should respect null if\n * the user put it there, but otherwise null is deleted as we use it as code\n * in restyle/relayout/update for \"delete this value\" whereas undefined means\n * \"ignore this edit\"\n */\nvar ARGS_PATTERN = /(^|\\.)args\\[/;\nfunction isDeletable(val, propStr) {\n return (val === undefined) || (val === null && !propStr.match(ARGS_PATTERN));\n}\n\nfunction npSet(cont, parts, propStr) {\n return function(val) {\n var curCont = cont;\n var propPart = '';\n var containerLevels = [[cont, propPart]];\n var toDelete = isDeletable(val, propStr);\n var curPart;\n var i;\n\n for(i = 0; i < parts.length - 1; i++) {\n curPart = parts[i];\n\n if(typeof curPart === 'number' && !isArrayOrTypedArray(curCont)) {\n throw 'array index but container is not an array';\n }\n\n // handle special -1 array index\n if(curPart === -1) {\n toDelete = !setArrayAll(curCont, parts.slice(i + 1), val, propStr);\n if(toDelete) break;\n else return;\n }\n\n if(!checkNewContainer(curCont, curPart, parts[i + 1], toDelete)) {\n break;\n }\n\n curCont = curCont[curPart];\n\n if(typeof curCont !== 'object' || curCont === null) {\n throw 'container is not an object';\n }\n\n propPart = joinPropStr(propPart, curPart);\n\n containerLevels.push([curCont, propPart]);\n }\n\n if(toDelete) {\n if(i === parts.length - 1) {\n delete curCont[parts[i]];\n\n // The one bit of pruning we still do: drop `undefined` from the end of arrays.\n // In case someone has already unset previous items, continue until we hit a\n // non-undefined value.\n if(Array.isArray(curCont) && +parts[i] === curCont.length - 1) {\n while(curCont.length && curCont[curCont.length - 1] === undefined) {\n curCont.pop();\n }\n }\n }\n } else curCont[parts[i]] = val;\n };\n}\n\nfunction joinPropStr(propStr, newPart) {\n var toAdd = newPart;\n if(isNumeric(newPart)) toAdd = '[' + newPart + ']';\n else if(propStr) toAdd = '.' + newPart;\n\n return propStr + toAdd;\n}\n\n// handle special -1 array index\nfunction setArrayAll(containerArray, innerParts, val, propStr) {\n var arrayVal = isArrayOrTypedArray(val);\n var allSet = true;\n var thisVal = val;\n var thisPropStr = propStr.replace('-1', 0);\n var deleteThis = arrayVal ? false : isDeletable(val, thisPropStr);\n var firstPart = innerParts[0];\n var i;\n\n for(i = 0; i < containerArray.length; i++) {\n thisPropStr = propStr.replace('-1', i);\n if(arrayVal) {\n thisVal = val[i % val.length];\n deleteThis = isDeletable(thisVal, thisPropStr);\n }\n if(deleteThis) allSet = false;\n if(!checkNewContainer(containerArray, i, firstPart, deleteThis)) {\n continue;\n }\n npSet(containerArray[i], innerParts, propStr.replace('-1', i))(thisVal);\n }\n return allSet;\n}\n\n/**\n * make new sub-container as needed.\n * returns false if there's no container and none is needed\n * because we're only deleting an attribute\n */\nfunction checkNewContainer(container, part, nextPart, toDelete) {\n if(container[part] === undefined) {\n if(toDelete) return false;\n\n if(typeof nextPart === 'number') container[part] = [];\n else container[part] = {};\n }\n return true;\n}\n\nfunction badContainer(container, propStr, propParts) {\n return {\n set: function() { throw 'bad container'; },\n get: function() {},\n astr: propStr,\n parts: propParts,\n obj: container\n };\n}\n","'use strict';\n\n// Simple helper functions\n// none of these need any external deps\n\nmodule.exports = function noop() {};\n","'use strict';\n\nvar d3 = require('@plotly/d3');\nvar isNumeric = require('fast-isnumeric');\n\nvar NOTEDATA = [];\n\n/**\n * notifier\n * @param {String} text The person's user name\n * @param {Number} [delay=1000] The delay time in milliseconds\n * or 'long' which provides 2000 ms delay time.\n * @return {undefined} this function does not return a value\n */\nmodule.exports = function(text, displayLength) {\n if(NOTEDATA.indexOf(text) !== -1) return;\n\n NOTEDATA.push(text);\n\n var ts = 1000;\n if(isNumeric(displayLength)) ts = displayLength;\n else if(displayLength === 'long') ts = 3000;\n\n var notifierContainer = d3.select('body')\n .selectAll('.plotly-notifier')\n .data([0]);\n notifierContainer.enter()\n .append('div')\n .classed('plotly-notifier', true);\n\n var notes = notifierContainer.selectAll('.notifier-note').data(NOTEDATA);\n\n function killNote(transition) {\n transition\n .duration(700)\n .style('opacity', 0)\n .each('end', function(thisText) {\n var thisIndex = NOTEDATA.indexOf(thisText);\n if(thisIndex !== -1) NOTEDATA.splice(thisIndex, 1);\n d3.select(this).remove();\n });\n }\n\n notes.enter().append('div')\n .classed('notifier-note', true)\n .style('opacity', 0)\n .each(function(thisText) {\n var note = d3.select(this);\n\n note.append('button')\n .classed('notifier-close', true)\n .html('×')\n .on('click', function() {\n note.transition().call(killNote);\n });\n\n var p = note.append('p');\n var lines = thisText.split(/
/g);\n for(var i = 0; i < lines.length; i++) {\n if(i) p.append('br');\n p.append('span').text(lines[i]);\n }\n\n if(displayLength === 'stick') {\n note.transition()\n .duration(350)\n .style('opacity', 1);\n } else {\n note.transition()\n .duration(700)\n .style('opacity', 1)\n .transition()\n .delay(ts)\n .call(killNote);\n }\n });\n};\n","'use strict';\n\nvar setCursor = require('./setcursor');\n\nvar STASHATTR = 'data-savedcursor';\nvar NO_CURSOR = '!!';\n\n/*\n * works with our CSS cursor classes (see css/_cursor.scss)\n * to override a previous cursor set on d3 single-element selections,\n * by moving the name of the original cursor to the data-savedcursor attr.\n * omit cursor to revert to the previously set value.\n */\nmodule.exports = function overrideCursor(el3, csr) {\n var savedCursor = el3.attr(STASHATTR);\n if(csr) {\n if(!savedCursor) {\n var classes = (el3.attr('class') || '').split(' ');\n for(var i = 0; i < classes.length; i++) {\n var cls = classes[i];\n if(cls.indexOf('cursor-') === 0) {\n el3.attr(STASHATTR, cls.substr(7))\n .classed(cls, false);\n }\n }\n if(!el3.attr(STASHATTR)) {\n el3.attr(STASHATTR, NO_CURSOR);\n }\n }\n setCursor(el3, csr);\n } else if(savedCursor) {\n el3.attr(STASHATTR, null);\n\n if(savedCursor === NO_CURSOR) setCursor(el3);\n else setCursor(el3, savedCursor);\n }\n};\n","'use strict';\n\nvar dot = require('./matrix').dot;\nvar BADNUM = require('../constants/numerical').BADNUM;\n\nvar polygon = module.exports = {};\n\n/**\n * Turn an array of [x, y] pairs into a polygon object\n * that can test if points are inside it\n *\n * @param ptsIn Array of [x, y] pairs\n *\n * @returns polygon Object {xmin, xmax, ymin, ymax, pts, contains}\n * (x|y)(min|max) are the bounding rect of the polygon\n * pts is the original array, with the first pair repeated at the end\n * contains is a function: (pt, omitFirstEdge)\n * pt is the [x, y] pair to test\n * omitFirstEdge truthy means points exactly on the first edge don't\n * count. This is for use adding one polygon to another so we\n * don't double-count the edge where they meet.\n * returns boolean: is pt inside the polygon (including on its edges)\n */\npolygon.tester = function tester(ptsIn) {\n var pts = ptsIn.slice();\n var xmin = pts[0][0];\n var xmax = xmin;\n var ymin = pts[0][1];\n var ymax = ymin;\n var i;\n\n if(\n pts[pts.length - 1][0] !== pts[0][0] ||\n pts[pts.length - 1][1] !== pts[0][1]\n ) {\n // close the polygon\n pts.push(pts[0]);\n }\n\n for(i = 1; i < pts.length; i++) {\n xmin = Math.min(xmin, pts[i][0]);\n xmax = Math.max(xmax, pts[i][0]);\n ymin = Math.min(ymin, pts[i][1]);\n ymax = Math.max(ymax, pts[i][1]);\n }\n\n // do we have a rectangle? Handle this here, so we can use the same\n // tester for the rectangular case without sacrificing speed\n\n var isRect = false;\n var rectFirstEdgeTest;\n\n if(pts.length === 5) {\n if(pts[0][0] === pts[1][0]) { // vert, horz, vert, horz\n if(pts[2][0] === pts[3][0] &&\n pts[0][1] === pts[3][1] &&\n pts[1][1] === pts[2][1]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[0] === pts[0][0]; };\n }\n } else if(pts[0][1] === pts[1][1]) { // horz, vert, horz, vert\n if(pts[2][1] === pts[3][1] &&\n pts[0][0] === pts[3][0] &&\n pts[1][0] === pts[2][0]) {\n isRect = true;\n rectFirstEdgeTest = function(pt) { return pt[1] === pts[0][1]; };\n }\n }\n }\n\n function rectContains(pt, omitFirstEdge) {\n var x = pt[0];\n var y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n if(omitFirstEdge && rectFirstEdgeTest(pt)) return false;\n\n return true;\n }\n\n function contains(pt, omitFirstEdge) {\n var x = pt[0];\n var y = pt[1];\n\n if(x === BADNUM || x < xmin || x > xmax || y === BADNUM || y < ymin || y > ymax) {\n // pt is outside the bounding box of polygon\n return false;\n }\n\n var imax = pts.length;\n var x1 = pts[0][0];\n var y1 = pts[0][1];\n var crossings = 0;\n var i;\n var x0;\n var y0;\n var xmini;\n var ycross;\n\n for(i = 1; i < imax; i++) {\n // find all crossings of a vertical line upward from pt with\n // polygon segments\n // crossings exactly at xmax don't count, unless the point is\n // exactly on the segment, then it counts as inside.\n x0 = x1;\n y0 = y1;\n x1 = pts[i][0];\n y1 = pts[i][1];\n xmini = Math.min(x0, x1);\n\n if(x < xmini || x > Math.max(x0, x1) || y > Math.max(y0, y1)) {\n // outside the bounding box of this segment, it's only a crossing\n // if it's below the box.\n\n continue;\n } else if(y < Math.min(y0, y1)) {\n // don't count the left-most point of the segment as a crossing\n // because we don't want to double-count adjacent crossings\n // UNLESS the polygon turns past vertical at exactly this x\n // Note that this is repeated below, but we can't factor it out\n // because\n if(x !== xmini) crossings++;\n } else {\n // inside the bounding box, check the actual line intercept\n\n // vertical segment - we know already that the point is exactly\n // on the segment, so mark the crossing as exactly at the point.\n if(x1 === x0) ycross = y;\n // any other angle\n else ycross = y0 + (x - x0) * (y1 - y0) / (x1 - x0);\n\n // exactly on the edge: counts as inside the polygon, unless it's the\n // first edge and we're omitting it.\n if(y === ycross) {\n if(i === 1 && omitFirstEdge) return false;\n return true;\n }\n\n if(y <= ycross && x !== xmini) crossings++;\n }\n }\n\n // if we've gotten this far, odd crossings means inside, even is outside\n return crossings % 2 === 1;\n }\n\n // detect if poly is degenerate\n var degenerate = true;\n var lastPt = pts[0];\n for(i = 1; i < pts.length; i++) {\n if(lastPt[0] !== pts[i][0] || lastPt[1] !== pts[i][1]) {\n degenerate = false;\n break;\n }\n }\n\n return {\n xmin: xmin,\n xmax: xmax,\n ymin: ymin,\n ymax: ymax,\n pts: pts,\n contains: isRect ? rectContains : contains,\n isRect: isRect,\n degenerate: degenerate\n };\n};\n\n/**\n * Test if a segment of a points array is bent or straight\n *\n * @param pts Array of [x, y] pairs\n * @param start the index of the proposed start of the straight section\n * @param end the index of the proposed end point\n * @param tolerance the max distance off the line connecting start and end\n * before the line counts as bent\n * @returns boolean: true means this segment is bent, false means straight\n */\npolygon.isSegmentBent = function isSegmentBent(pts, start, end, tolerance) {\n var startPt = pts[start];\n var segment = [pts[end][0] - startPt[0], pts[end][1] - startPt[1]];\n var segmentSquared = dot(segment, segment);\n var segmentLen = Math.sqrt(segmentSquared);\n var unitPerp = [-segment[1] / segmentLen, segment[0] / segmentLen];\n var i;\n var part;\n var partParallel;\n\n for(i = start + 1; i < end; i++) {\n part = [pts[i][0] - startPt[0], pts[i][1] - startPt[1]];\n partParallel = dot(part, segment);\n\n if(partParallel < 0 || partParallel > segmentSquared ||\n Math.abs(dot(part, unitPerp)) > tolerance) return true;\n }\n return false;\n};\n\n/**\n * Make a filtering polygon, to minimize the number of segments\n *\n * @param pts Array of [x, y] pairs (must start with at least 1 pair)\n * @param tolerance the maximum deviation from straight allowed for\n * removing points to simplify the polygon\n *\n * @returns Object {addPt, raw, filtered}\n * addPt is a function(pt: [x, y] pair) to add a raw point and\n * continue filtering\n * raw is all the input points\n * filtered is the resulting filtered Array of [x, y] pairs\n */\npolygon.filter = function filter(pts, tolerance) {\n var ptsFiltered = [pts[0]];\n var doneRawIndex = 0;\n var doneFilteredIndex = 0;\n\n function addPt(pt) {\n pts.push(pt);\n var prevFilterLen = ptsFiltered.length;\n var iLast = doneRawIndex;\n ptsFiltered.splice(doneFilteredIndex + 1);\n\n for(var i = iLast + 1; i < pts.length; i++) {\n if(i === pts.length - 1 || polygon.isSegmentBent(pts, iLast, i + 1, tolerance)) {\n ptsFiltered.push(pts[i]);\n if(ptsFiltered.length < prevFilterLen - 2) {\n doneRawIndex = i;\n doneFilteredIndex = ptsFiltered.length - 1;\n }\n iLast = i;\n }\n }\n }\n\n if(pts.length > 1) {\n var lastPt = pts.pop();\n addPt(lastPt);\n }\n\n return {\n addPt: addPt,\n raw: pts,\n filtered: ptsFiltered\n };\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar isMobileOrTablet = require('is-mobile');\n\nmodule.exports = function preserveDrawingBuffer(opts) {\n var ua;\n\n if(opts && opts.hasOwnProperty('userAgent')) {\n ua = opts.userAgent;\n } else {\n ua = getUserAgent();\n }\n\n if(typeof ua !== 'string') return true;\n\n var enable = isMobileOrTablet({\n ua: { headers: {'user-agent': ua }},\n tablet: true,\n featureDetect: false\n });\n\n if(!enable) {\n var allParts = ua.split(' ');\n for(var i = 1; i < allParts.length; i++) {\n var part = allParts[i];\n if(part.indexOf('Safari') !== -1) {\n // find Safari version\n for(var k = i - 1; k > -1; k--) {\n var prevPart = allParts[k];\n if(prevPart.substr(0, 8) === 'Version/') {\n var v = prevPart.substr(8).split('.')[0];\n if(isNumeric(v)) v = +v;\n if(v >= 13) return true;\n }\n }\n }\n }\n }\n\n return enable;\n};\n\nfunction getUserAgent() {\n // similar to https://github.com/juliangruber/is-mobile/blob/91ca39ccdd4cfc5edfb5391e2515b923a730fbea/index.js#L14-L17\n var ua;\n if(typeof navigator !== 'undefined') {\n ua = navigator.userAgent;\n }\n\n if(\n ua &&\n ua.headers &&\n typeof ua.headers['user-agent'] === 'string'\n ) {\n ua = ua.headers['user-agent'];\n }\n\n return ua;\n}\n","'use strict';\n\n/**\n * Push array with unique items\n *\n * Ignores falsy items, except 0 so we can use it to construct arrays of indices.\n *\n * @param {array} array\n * array to be filled\n * @param {any} item\n * item to be or not to be inserted\n * @return {array}\n * ref to array (now possibly containing one more item)\n *\n */\nmodule.exports = function pushUnique(array, item) {\n if(item instanceof RegExp) {\n var itemStr = item.toString();\n for(var i = 0; i < array.length; i++) {\n if(array[i] instanceof RegExp && array[i].toString() === itemStr) {\n return array;\n }\n }\n array.push(item);\n } else if((item || item === 0) && array.indexOf(item) === -1) array.push(item);\n\n return array;\n};\n","'use strict';\n\nvar Lib = require('../lib');\nvar dfltConfig = require('../plot_api/plot_config').dfltConfig;\n\n/**\n * Copy arg array *without* removing `undefined` values from objects.\n *\n * @param gd\n * @param args\n * @returns {Array}\n */\nfunction copyArgArray(gd, args) {\n var copy = [];\n var arg;\n\n for(var i = 0; i < args.length; i++) {\n arg = args[i];\n\n if(arg === gd) copy[i] = arg;\n else if(typeof arg === 'object') {\n copy[i] = Array.isArray(arg) ?\n Lib.extendDeep([], arg) :\n Lib.extendDeepAll({}, arg);\n } else copy[i] = arg;\n }\n\n return copy;\n}\n\n\n// -----------------------------------------------------\n// Undo/Redo queue for plots\n// -----------------------------------------------------\n\n\nvar queue = {};\n\n// TODO: disable/enable undo and redo buttons appropriately\n\n/**\n * Add an item to the undoQueue for a graphDiv\n *\n * @param gd\n * @param undoFunc Function undo this operation\n * @param undoArgs Args to supply undoFunc with\n * @param redoFunc Function to redo this operation\n * @param redoArgs Args to supply redoFunc with\n */\nqueue.add = function(gd, undoFunc, undoArgs, redoFunc, redoArgs) {\n var queueObj,\n queueIndex;\n\n // make sure we have the queue and our position in it\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n queueIndex = gd.undoQueue.index;\n\n // if we're already playing an undo or redo, or if this is an auto operation\n // (like pane resize... any others?) then we don't save this to the undo queue\n if(gd.autoplay) {\n if(!gd.undoQueue.inSequence) gd.autoplay = false;\n return;\n }\n\n // if we're not in a sequence or are just starting, we need a new queue item\n if(!gd.undoQueue.sequence || gd.undoQueue.beginSequence) {\n queueObj = {undo: {calls: [], args: []}, redo: {calls: [], args: []}};\n gd.undoQueue.queue.splice(queueIndex, gd.undoQueue.queue.length - queueIndex, queueObj);\n gd.undoQueue.index += 1;\n } else {\n queueObj = gd.undoQueue.queue[queueIndex - 1];\n }\n gd.undoQueue.beginSequence = false;\n\n // we unshift to handle calls for undo in a forward for loop later\n if(queueObj) {\n queueObj.undo.calls.unshift(undoFunc);\n queueObj.undo.args.unshift(undoArgs);\n queueObj.redo.calls.push(redoFunc);\n queueObj.redo.args.push(redoArgs);\n }\n\n if(gd.undoQueue.queue.length > dfltConfig.queueLength) {\n gd.undoQueue.queue.shift();\n gd.undoQueue.index--;\n }\n};\n\n/**\n * Begin a sequence of undoQueue changes\n *\n * @param gd\n */\nqueue.startSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = true;\n gd.undoQueue.beginSequence = true;\n};\n\n/**\n * Stop a sequence of undoQueue changes\n *\n * Call this *after* you're sure your undo chain has ended\n *\n * @param gd\n */\nqueue.stopSequence = function(gd) {\n gd.undoQueue = gd.undoQueue || {index: 0, queue: [], sequence: false};\n gd.undoQueue.sequence = false;\n gd.undoQueue.beginSequence = false;\n};\n\n/**\n * Move one step back in the undo queue, and undo the object there.\n *\n * @param gd\n */\nqueue.undo = function undo(gd) {\n var queueObj, i;\n\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index <= 0) {\n return;\n }\n\n // index is pointing to next *forward* queueObj, point to the one we're undoing\n gd.undoQueue.index--;\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.undo.calls.length; i++) {\n queue.plotDo(gd, queueObj.undo.calls[i], queueObj.undo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n};\n\n/**\n * Redo the current object in the undo, then move forward in the queue.\n *\n * @param gd\n */\nqueue.redo = function redo(gd) {\n var queueObj, i;\n\n if(gd.undoQueue === undefined ||\n isNaN(gd.undoQueue.index) ||\n gd.undoQueue.index >= gd.undoQueue.queue.length) {\n return;\n }\n\n // get the queueObj for instructions on how to undo\n queueObj = gd.undoQueue.queue[gd.undoQueue.index];\n\n // this sequence keeps things from adding to the queue during undo/redo\n gd.undoQueue.inSequence = true;\n for(i = 0; i < queueObj.redo.calls.length; i++) {\n queue.plotDo(gd, queueObj.redo.calls[i], queueObj.redo.args[i]);\n }\n gd.undoQueue.inSequence = false;\n gd.autoplay = false;\n\n // index is pointing to the thing we just redid, move it\n gd.undoQueue.index++;\n};\n\n/**\n * Called by undo/redo to make the actual changes.\n *\n * Not meant to be called publically, but included for mocking out in tests.\n *\n * @param gd\n * @param func\n * @param args\n */\nqueue.plotDo = function(gd, func, args) {\n gd.autoplay = true;\n\n // this *won't* copy gd and it preserves `undefined` properties!\n args = copyArgArray(gd, args);\n\n // call the supplied function\n func.apply(null, args);\n};\n\nmodule.exports = queue;\n","'use strict';\n\n/*\n * make a regex for matching counter ids/names ie xaxis, xaxis2, xaxis10...\n *\n * @param {string} head: the head of the pattern, eg 'x' matches 'x', 'x2', 'x10' etc.\n * 'xy' is a special case for cartesian subplots: it matches 'x2y3' etc\n * @param {Optional(string)} tail: a fixed piece after the id\n * eg counterRegex('scene', '.annotations') for scene2.annotations etc.\n * @param {boolean} openEnded: if true, the string may continue past the match.\n * @param {boolean} matchBeginning: if false, the string may start before the match.\n */\nexports.counter = function(head, tail, openEnded, matchBeginning) {\n var fullTail = (tail || '') + (openEnded ? '' : '$');\n var startWithPrefix = matchBeginning === false ? '' : '^';\n if(head === 'xy') {\n return new RegExp(startWithPrefix + 'x([2-9]|[1-9][0-9]+)?y([2-9]|[1-9][0-9]+)?' + fullTail);\n }\n return new RegExp(startWithPrefix + head + '([2-9]|[1-9][0-9]+)?' + fullTail);\n};\n","'use strict';\n\n// ASCEND: chop off the last nesting level - either [] or . - to ascend\n// the attribute tree. the remaining attrString is in match[1]\nvar ASCEND = /^(.*)(\\.[^\\.\\[\\]]+|\\[\\d\\])$/;\n\n// SIMPLEATTR: is this an un-nested attribute? (no dots or brackets)\nvar SIMPLEATTR = /^[^\\.\\[\\]]+$/;\n\n/*\n * calculate a relative attribute string, similar to a relative path\n *\n * @param {string} baseAttr:\n * an attribute string, such as 'annotations[3].x'. The \"current location\"\n * is the attribute string minus the last component ('annotations[3]')\n * @param {string} relativeAttr:\n * a route to the desired attribute string, using '^' to ascend\n *\n * @return {string} attrString:\n * for example:\n * relativeAttr('annotations[3].x', 'y') = 'annotations[3].y'\n * relativeAttr('annotations[3].x', '^[2].z') = 'annotations[2].z'\n * relativeAttr('annotations[3].x', '^^margin') = 'margin'\n * relativeAttr('annotations[3].x', '^^margin.r') = 'margin.r'\n */\nmodule.exports = function(baseAttr, relativeAttr) {\n while(relativeAttr) {\n var match = baseAttr.match(ASCEND);\n\n if(match) baseAttr = match[1];\n else if(baseAttr.match(SIMPLEATTR)) baseAttr = '';\n else throw new Error('bad relativeAttr call:' + [baseAttr, relativeAttr]);\n\n if(relativeAttr.charAt(0) === '^') relativeAttr = relativeAttr.slice(1);\n else break;\n }\n\n if(baseAttr && relativeAttr.charAt(0) !== '[') {\n return baseAttr + '.' + relativeAttr;\n }\n return baseAttr + relativeAttr;\n};\n","'use strict';\n\nvar isArrayOrTypedArray = require('./array').isArrayOrTypedArray;\nvar isPlainObject = require('./is_plain_object');\n\n/**\n * Relink private _keys and keys with a function value from one container\n * to the new container.\n * Relink means copying if object is pass-by-value and adding a reference\n * if object is pass-by-ref.\n * This prevents deepCopying massive structures like a webgl context.\n */\nmodule.exports = function relinkPrivateKeys(toContainer, fromContainer) {\n for(var k in fromContainer) {\n var fromVal = fromContainer[k];\n var toVal = toContainer[k];\n\n if(toVal === fromVal) continue;\n\n if(k.charAt(0) === '_' || typeof fromVal === 'function') {\n // if it already exists at this point, it's something\n // that we recreate each time around, so ignore it\n if(k in toContainer) continue;\n\n toContainer[k] = fromVal;\n } else if(isArrayOrTypedArray(fromVal) && isArrayOrTypedArray(toVal) && isPlainObject(fromVal[0])) {\n // filter out data_array items that can contain user objects\n // most of the time the toVal === fromVal check will catch these early\n // but if the user makes new ones we also don't want to recurse in.\n if(k === 'customdata' || k === 'ids') continue;\n\n // recurse into arrays containers\n var minLen = Math.min(fromVal.length, toVal.length);\n for(var j = 0; j < minLen; j++) {\n if((toVal[j] !== fromVal[j]) && isPlainObject(fromVal[j]) && isPlainObject(toVal[j])) {\n relinkPrivateKeys(toVal[j], fromVal[j]);\n }\n }\n } else if(isPlainObject(fromVal) && isPlainObject(toVal)) {\n // recurse into objects, but only if they still exist\n relinkPrivateKeys(toVal, fromVal);\n\n if(!Object.keys(toVal).length) delete toContainer[k];\n }\n }\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar loggers = require('./loggers');\nvar identity = require('./identity');\nvar BADNUM = require('../constants/numerical').BADNUM;\n\n// don't trust floating point equality - fraction of bin size to call\n// \"on the line\" and ensure that they go the right way specified by\n// linelow\nvar roundingError = 1e-9;\n\n\n/**\n * findBin - find the bin for val - note that it can return outside the\n * bin range any pos. or neg. integer for linear bins, or -1 or\n * bins.length-1 for explicit.\n * bins is either an object {start,size,end} or an array length #bins+1\n * bins can be either increasing or decreasing but must be monotonic\n * for linear bins, we can just calculate. For listed bins, run a binary\n * search linelow (truthy) says the bin boundary should be attributed to\n * the lower bin rather than the default upper bin\n */\nexports.findBin = function(val, bins, linelow) {\n if(isNumeric(bins.start)) {\n return linelow ?\n Math.ceil((val - bins.start) / bins.size - roundingError) - 1 :\n Math.floor((val - bins.start) / bins.size + roundingError);\n } else {\n var n1 = 0;\n var n2 = bins.length;\n var c = 0;\n var binSize = (n2 > 1) ? (bins[n2 - 1] - bins[0]) / (n2 - 1) : 1;\n var n, test;\n if(binSize >= 0) {\n test = linelow ? lessThan : lessOrEqual;\n } else {\n test = linelow ? greaterOrEqual : greaterThan;\n }\n val += binSize * roundingError * (linelow ? -1 : 1) * (binSize >= 0 ? 1 : -1);\n // c is just to avoid infinite loops if there's an error\n while(n1 < n2 && c++ < 100) {\n n = Math.floor((n1 + n2) / 2);\n if(test(bins[n], val)) n1 = n + 1;\n else n2 = n;\n }\n if(c > 90) loggers.log('Long binary search...');\n return n1 - 1;\n }\n};\n\nfunction lessThan(a, b) { return a < b; }\nfunction lessOrEqual(a, b) { return a <= b; }\nfunction greaterThan(a, b) { return a > b; }\nfunction greaterOrEqual(a, b) { return a >= b; }\n\nexports.sorterAsc = function(a, b) { return a - b; };\nexports.sorterDes = function(a, b) { return b - a; };\n\n/**\n * find distinct values in an array, lumping together ones that appear to\n * just be off by a rounding error\n * return the distinct values and the minimum difference between any two\n */\nexports.distinctVals = function(valsIn) {\n var vals = valsIn.slice(); // otherwise we sort the original array...\n vals.sort(exports.sorterAsc); // undefined listed in the end - also works on IE11\n\n var last;\n for(last = vals.length - 1; last > -1; last--) {\n if(vals[last] !== BADNUM) break;\n }\n\n var minDiff = (vals[last] - vals[0]) || 1;\n var errDiff = minDiff / (last || 1) / 10000;\n var newVals = [];\n var preV;\n for(var i = 0; i <= last; i++) {\n var v = vals[i];\n\n // make sure values aren't just off by a rounding error\n var diff = v - preV;\n\n if(preV === undefined) {\n newVals.push(v);\n preV = v;\n } else if(diff > errDiff) {\n minDiff = Math.min(minDiff, diff);\n\n newVals.push(v);\n preV = v;\n }\n }\n\n return {vals: newVals, minDiff: minDiff};\n};\n\n/**\n * return the smallest element from (sorted) array arrayIn that's bigger than val,\n * or (reverse) the largest element smaller than val\n * used to find the best tick given the minimum (non-rounded) tick\n * particularly useful for date/time where things are not powers of 10\n * binary search is probably overkill here...\n */\nexports.roundUp = function(val, arrayIn, reverse) {\n var low = 0;\n var high = arrayIn.length - 1;\n var mid;\n var c = 0;\n var dlow = reverse ? 0 : 1;\n var dhigh = reverse ? 1 : 0;\n var rounded = reverse ? Math.ceil : Math.floor;\n // c is just to avoid infinite loops if there's an error\n while(low < high && c++ < 100) {\n mid = rounded((low + high) / 2);\n if(arrayIn[mid] <= val) low = mid + dlow;\n else high = mid - dhigh;\n }\n return arrayIn[low];\n};\n\n/**\n * Tweak to Array.sort(sortFn) that improves performance for pre-sorted arrays\n *\n * Note that newer browsers (such as Chrome v70+) are starting to pick up\n * on pre-sorted arrays which may render the following optimization unnecessary\n * in the future.\n *\n * Motivation: sometimes we need to sort arrays but the input is likely to\n * already be sorted. Browsers don't seem to pick up on pre-sorted arrays,\n * and in fact Chrome is actually *slower* sorting pre-sorted arrays than purely\n * random arrays. FF is at least faster if the array is pre-sorted, but still\n * not as fast as it could be.\n * Here's how this plays out sorting a length-1e6 array:\n *\n * Calls to Sort FN | Chrome bare | FF bare | Chrome tweak | FF tweak\n * | v68.0 Mac | v61.0 Mac| |\n * ------------------+---------------+-----------+----------------+------------\n * ordered | 30.4e6 | 10.1e6 | 1e6 | 1e6\n * reversed | 29.4e6 | 9.9e6 | 1e6 + reverse | 1e6 + reverse\n * random | ~21e6 | ~18.7e6 | ~21e6 | ~18.7e6\n *\n * So this is a substantial win for pre-sorted (ordered or exactly reversed)\n * arrays. Including this wrapper on an unsorted array adds a penalty that will\n * in general be only a few calls to the sort function. The only case this\n * penalty will be significant is if the array is mostly sorted but there are\n * a few unsorted items near the end, but the penalty is still at most N calls\n * out of (for N=1e6) ~20N total calls\n *\n * @param {Array} array: the array, to be sorted in place\n * @param {function} sortFn: As in Array.sort, function(a, b) that puts\n * item a before item b if the return is negative, a after b if positive,\n * and no change if zero.\n * @return {Array}: the original array, sorted in place.\n */\nexports.sort = function(array, sortFn) {\n var notOrdered = 0;\n var notReversed = 0;\n for(var i = 1; i < array.length; i++) {\n var pairOrder = sortFn(array[i], array[i - 1]);\n if(pairOrder < 0) notOrdered = 1;\n else if(pairOrder > 0) notReversed = 1;\n if(notOrdered && notReversed) return array.sort(sortFn);\n }\n return notReversed ? array : array.reverse();\n};\n\n/**\n * find index in array 'arr' that minimizes 'fn'\n *\n * @param {array} arr : array where to search\n * @param {fn (optional)} fn : function to minimize,\n * if not given, fn is the identity function\n * @return {integer}\n */\nexports.findIndexOfMin = function(arr, fn) {\n fn = fn || identity;\n\n var min = Infinity;\n var ind;\n\n for(var i = 0; i < arr.length; i++) {\n var v = fn(arr[i]);\n if(v < min) {\n min = v;\n ind = i;\n }\n }\n return ind;\n};\n","'use strict';\n\n// works with our CSS cursor classes (see css/_cursor.scss)\n// to apply cursors to d3 single-element selections.\n// omit cursor to revert to the default.\nmodule.exports = function setCursor(el3, csr) {\n (el3.attr('class') || '').split(' ').forEach(function(cls) {\n if(cls.indexOf('cursor-') === 0) el3.classed(cls, false);\n });\n\n if(csr) el3.classed('cursor-' + csr, true);\n};\n","'use strict';\n\nmodule.exports = function sortObjectKeys(obj) {\n return Object.keys(obj).sort();\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar isArrayOrTypedArray = require('./array').isArrayOrTypedArray;\n\n/**\n * aggNums() returns the result of an aggregate function applied to an array of\n * values, where non-numerical values have been tossed out.\n *\n * @param {function} f - aggregation function (e.g., Math.min)\n * @param {Number} v - initial value (continuing from previous calls)\n * if there's no continuing value, use null for selector-type\n * functions (max,min), or 0 for summations\n * @param {Array} a - array to aggregate (may be nested, we will recurse,\n * but all elements must have the same dimension)\n * @param {Number} len - maximum length of a to aggregate\n * @return {Number} - result of f applied to a starting from v\n */\nexports.aggNums = function(f, v, a, len) {\n var i,\n b;\n if(!len || len > a.length) len = a.length;\n if(!isNumeric(v)) v = false;\n if(isArrayOrTypedArray(a[0])) {\n b = new Array(len);\n for(i = 0; i < len; i++) b[i] = exports.aggNums(f, v, a[i]);\n a = b;\n }\n\n for(i = 0; i < len; i++) {\n if(!isNumeric(v)) v = a[i];\n else if(isNumeric(a[i])) v = f(+v, +a[i]);\n }\n return v;\n};\n\n/**\n * mean & std dev functions using aggNums, so it handles non-numerics nicely\n * even need to use aggNums instead of .length, to toss out non-numerics\n */\nexports.len = function(data) {\n return exports.aggNums(function(a) { return a + 1; }, 0, data);\n};\n\nexports.mean = function(data, len) {\n if(!len) len = exports.len(data);\n return exports.aggNums(function(a, b) { return a + b; }, 0, data) / len;\n};\n\nexports.midRange = function(numArr) {\n if(numArr === undefined || numArr.length === 0) return undefined;\n return (exports.aggNums(Math.max, null, numArr) + exports.aggNums(Math.min, null, numArr)) / 2;\n};\n\nexports.variance = function(data, len, mean) {\n if(!len) len = exports.len(data);\n if(!isNumeric(mean)) mean = exports.mean(data, len);\n\n return exports.aggNums(function(a, b) {\n return a + Math.pow(b - mean, 2);\n }, 0, data) / len;\n};\n\nexports.stdev = function(data, len, mean) {\n return Math.sqrt(exports.variance(data, len, mean));\n};\n\n/**\n * median of a finite set of numbers\n * reference page: https://en.wikipedia.org/wiki/Median#Finite_set_of_numbers\n**/\nexports.median = function(data) {\n var b = data.slice().sort();\n return exports.interp(b, 0.5);\n};\n\n/**\n * interp() computes a percentile (quantile) for a given distribution.\n * We interpolate the distribution (to compute quantiles, we follow method #10 here:\n * http://jse.amstat.org/v14n3/langford.html).\n * Typically the index or rank (n * arr.length) may be non-integer.\n * For reference: ends are clipped to the extreme values in the array;\n * For box plots: index you get is half a point too high (see\n * http://en.wikipedia.org/wiki/Percentile#Nearest_rank) but note that this definition\n * indexes from 1 rather than 0, so we subtract 1/2 (instead of add).\n *\n * @param {Array} arr - This array contains the values that make up the distribution.\n * @param {Number} n - Between 0 and 1, n = p/100 is such that we compute the p^th percentile.\n * For example, the 50th percentile (or median) corresponds to n = 0.5\n * @return {Number} - percentile\n */\nexports.interp = function(arr, n) {\n if(!isNumeric(n)) throw 'n should be a finite number';\n n = n * arr.length - 0.5;\n if(n < 0) return arr[0];\n if(n > arr.length - 1) return arr[arr.length - 1];\n var frac = n % 1;\n return frac * arr[Math.ceil(n)] + (1 - frac) * arr[Math.floor(n)];\n};\n","'use strict';\n\nvar constants = require('../constants/pixelated_image');\nvar Drawing = require('../components/drawing');\nvar Lib = require('../lib');\n\nvar _supportsPixelated = null;\n\n/**\n * Check browser support for pixelated image rendering\n *\n * @return {boolean}\n */\nfunction supportsPixelatedImage() {\n if(_supportsPixelated !== null) { // only run the feature detection once\n return _supportsPixelated;\n }\n\n _supportsPixelated = false;\n\n // @see https://github.com/plotly/plotly.js/issues/6604\n var unsupportedBrowser = Lib.isIE() || Lib.isSafari() || Lib.isIOS();\n\n if(window.navigator.userAgent && !unsupportedBrowser) {\n var declarations = Array.from(constants.CSS_DECLARATIONS).reverse();\n\n var supports = (window.CSS && window.CSS.supports) || window.supportsCSS;\n if(typeof supports === 'function') {\n _supportsPixelated = declarations.some(function(d) {\n return supports.apply(null, d);\n });\n } else {\n var image3 = Drawing.tester.append('image')\n .attr('style', constants.STYLE);\n\n var cStyles = window.getComputedStyle(image3.node());\n var imageRendering = cStyles.imageRendering;\n\n _supportsPixelated = declarations.some(function(d) {\n var value = d[1];\n return (\n imageRendering === value ||\n imageRendering === value.toLowerCase()\n );\n });\n\n image3.remove();\n }\n }\n\n return _supportsPixelated;\n}\n\nmodule.exports = supportsPixelatedImage;\n","'use strict';\n\n/* global MathJax:false */\n\nvar d3 = require('@plotly/d3');\n\nvar Lib = require('../lib');\nvar strTranslate = Lib.strTranslate;\nvar xmlnsNamespaces = require('../constants/xmlns_namespaces');\nvar LINE_SPACING = require('../constants/alignment').LINE_SPACING;\n\n// text converter\n\nvar FIND_TEX = /([^$]*)([$]+[^$]*[$]+)([^$]*)/;\n\nexports.convertToTspans = function(_context, gd, _callback) {\n var str = _context.text();\n\n // Until we get tex integrated more fully (so it can be used along with non-tex)\n // allow some elements to prohibit it by attaching 'data-notex' to the original\n var tex = (!_context.attr('data-notex')) &&\n gd && gd._context.typesetMath &&\n (typeof MathJax !== 'undefined') &&\n str.match(FIND_TEX);\n\n var parent = d3.select(_context.node().parentNode);\n if(parent.empty()) return;\n var svgClass = (_context.attr('class')) ? _context.attr('class').split(' ')[0] : 'text';\n svgClass += '-math';\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n _context.style('display', null)\n .attr({\n // some callers use data-unformatted *from the element* in 'cancel'\n // so we need it here even if we're going to turn it into math\n // these two (plus style and text-anchor attributes) form the key we're\n // going to use for Drawing.bBox\n 'data-unformatted': str,\n 'data-math': 'N'\n });\n\n function showText() {\n if(!parent.empty()) {\n svgClass = _context.attr('class') + '-math';\n parent.select('svg.' + svgClass).remove();\n }\n _context.text('')\n .style('white-space', 'pre');\n\n var hasLink = buildSVGText(_context.node(), str);\n\n if(hasLink) {\n // at least in Chrome, pointer-events does not seem\n // to be honored in children of elements\n // so if we have an anchor, we have to make the\n // whole element respond\n _context.style('pointer-events', 'all');\n }\n\n exports.positionText(_context);\n\n if(_callback) _callback.call(_context);\n }\n\n if(tex) {\n ((gd && gd._promises) || []).push(new Promise(function(resolve) {\n _context.style('display', 'none');\n var fontSize = parseInt(_context.node().style.fontSize, 10);\n var config = {fontSize: fontSize};\n\n texToSVG(tex[2], config, function(_svgEl, _glyphDefs, _svgBBox) {\n parent.selectAll('svg.' + svgClass).remove();\n parent.selectAll('g.' + svgClass + '-group').remove();\n\n var newSvg = _svgEl && _svgEl.select('svg');\n if(!newSvg || !newSvg.node()) {\n showText();\n resolve();\n return;\n }\n\n var mathjaxGroup = parent.append('g')\n .classed(svgClass + '-group', true)\n .attr({\n 'pointer-events': 'none',\n 'data-unformatted': str,\n 'data-math': 'Y'\n });\n\n mathjaxGroup.node().appendChild(newSvg.node());\n\n // stitch the glyph defs\n if(_glyphDefs && _glyphDefs.node()) {\n newSvg.node().insertBefore(_glyphDefs.node().cloneNode(true),\n newSvg.node().firstChild);\n }\n\n var w0 = _svgBBox.width;\n var h0 = _svgBBox.height;\n\n newSvg.attr({\n class: svgClass,\n height: h0,\n preserveAspectRatio: 'xMinYMin meet'\n })\n .style({overflow: 'visible', 'pointer-events': 'none'});\n\n var fill = _context.node().style.fill || 'black';\n var g = newSvg.select('g');\n g.attr({fill: fill, stroke: fill});\n\n var bb = g.node().getBoundingClientRect();\n var w = bb.width;\n var h = bb.height;\n\n if(w > w0 || h > h0) {\n // this happen in firefox v82+ | see https://bugzilla.mozilla.org/show_bug.cgi?id=1709251 addressed\n // temporary fix:\n newSvg.style('overflow', 'hidden');\n bb = newSvg.node().getBoundingClientRect();\n w = bb.width;\n h = bb.height;\n }\n\n var x = +_context.attr('x');\n var y = +_context.attr('y');\n\n // font baseline is about 1/4 fontSize below centerline\n var textHeight = fontSize || _context.node().getBoundingClientRect().height;\n var dy = -textHeight / 4;\n\n if(svgClass[0] === 'y') {\n mathjaxGroup.attr({\n transform: 'rotate(' + [-90, x, y] +\n ')' + strTranslate(-w / 2, dy - h / 2)\n });\n } else if(svgClass[0] === 'l') {\n y = dy - h / 2;\n } else if(svgClass[0] === 'a' && svgClass.indexOf('atitle') !== 0) {\n x = 0;\n y = dy;\n } else {\n var anchor = _context.attr('text-anchor');\n\n x = x - w * (\n anchor === 'middle' ? 0.5 :\n anchor === 'end' ? 1 : 0\n );\n y = y + dy - h / 2;\n }\n\n newSvg.attr({\n x: x,\n y: y\n });\n\n if(_callback) _callback.call(_context, mathjaxGroup);\n resolve(mathjaxGroup);\n });\n }));\n } else showText();\n\n return _context;\n};\n\n\n// MathJax\n\nvar LT_MATCH = /(<|<|<)/g;\nvar GT_MATCH = /(>|>|>)/g;\n\nfunction cleanEscapesForTex(s) {\n return s.replace(LT_MATCH, '\\\\lt ')\n .replace(GT_MATCH, '\\\\gt ');\n}\n\nvar inlineMath = [['$', '$'], ['\\\\(', '\\\\)']];\n\nfunction texToSVG(_texString, _config, _callback) {\n var MathJaxVersion = parseInt(\n (MathJax.version || '').split('.')[0]\n );\n\n if(\n MathJaxVersion !== 2 &&\n MathJaxVersion !== 3\n ) {\n Lib.warn('No MathJax version:', MathJax.version);\n return;\n }\n\n var originalRenderer,\n originalConfig,\n originalProcessSectionDelay,\n tmpDiv;\n\n var setConfig2 = function() {\n originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);\n\n originalProcessSectionDelay = MathJax.Hub.processSectionDelay;\n if(MathJax.Hub.processSectionDelay !== undefined) {\n // MathJax 2.5+ but not 3+\n MathJax.Hub.processSectionDelay = 0;\n }\n\n return MathJax.Hub.Config({\n messageStyle: 'none',\n tex2jax: {\n inlineMath: inlineMath\n },\n displayAlign: 'left',\n });\n };\n\n var setConfig3 = function() {\n originalConfig = Lib.extendDeepAll({}, MathJax.config);\n\n if(!MathJax.config.tex) {\n MathJax.config.tex = {};\n }\n\n MathJax.config.tex.inlineMath = inlineMath;\n };\n\n var setRenderer2 = function() {\n originalRenderer = MathJax.Hub.config.menuSettings.renderer;\n if(originalRenderer !== 'SVG') {\n return MathJax.Hub.setRenderer('SVG');\n }\n };\n\n var setRenderer3 = function() {\n originalRenderer = MathJax.config.startup.output;\n if(originalRenderer !== 'svg') {\n MathJax.config.startup.output = 'svg';\n }\n };\n\n var initiateMathJax = function() {\n var randomID = 'math-output-' + Lib.randstr({}, 64);\n tmpDiv = d3.select('body').append('div')\n .attr({id: randomID})\n .style({\n visibility: 'hidden',\n position: 'absolute',\n 'font-size': _config.fontSize + 'px'\n })\n .text(cleanEscapesForTex(_texString));\n\n var tmpNode = tmpDiv.node();\n\n return MathJaxVersion === 2 ?\n MathJax.Hub.Typeset(tmpNode) :\n MathJax.typeset([tmpNode]);\n };\n\n var finalizeMathJax = function() {\n var sel = tmpDiv.select(\n MathJaxVersion === 2 ? '.MathJax_SVG' : '.MathJax'\n );\n\n var node = !sel.empty() && tmpDiv.select('svg').node();\n if(!node) {\n Lib.log('There was an error in the tex syntax.', _texString);\n _callback();\n } else {\n var nodeBBox = node.getBoundingClientRect();\n var glyphDefs;\n if(MathJaxVersion === 2) {\n glyphDefs = d3.select('body').select('#MathJax_SVG_glyphs');\n } else {\n glyphDefs = sel.select('defs');\n }\n _callback(sel, glyphDefs, nodeBBox);\n }\n\n tmpDiv.remove();\n };\n\n var resetRenderer2 = function() {\n if(originalRenderer !== 'SVG') {\n return MathJax.Hub.setRenderer(originalRenderer);\n }\n };\n\n var resetRenderer3 = function() {\n if(originalRenderer !== 'svg') {\n MathJax.config.startup.output = originalRenderer;\n }\n };\n\n var resetConfig2 = function() {\n if(originalProcessSectionDelay !== undefined) {\n MathJax.Hub.processSectionDelay = originalProcessSectionDelay;\n }\n return MathJax.Hub.Config(originalConfig);\n };\n\n var resetConfig3 = function() {\n MathJax.config = originalConfig;\n };\n\n if(MathJaxVersion === 2) {\n MathJax.Hub.Queue(\n setConfig2,\n setRenderer2,\n initiateMathJax,\n finalizeMathJax,\n resetRenderer2,\n resetConfig2\n );\n } else if(MathJaxVersion === 3) {\n setConfig3();\n setRenderer3();\n MathJax.startup.defaultReady();\n\n MathJax.startup.promise.then(function() {\n initiateMathJax();\n finalizeMathJax();\n\n resetRenderer3();\n resetConfig3();\n });\n }\n}\n\nvar TAG_STYLES = {\n // would like to use baseline-shift for sub/sup but FF doesn't support it\n // so we need to use dy along with the uber hacky shift-back-to\n // baseline below\n sup: 'font-size:70%',\n sub: 'font-size:70%',\n b: 'font-weight:bold',\n i: 'font-style:italic',\n a: 'cursor:pointer',\n span: '',\n em: 'font-style:italic;font-weight:bold'\n};\n\n// baseline shifts for sub and sup\nvar SHIFT_DY = {\n sub: '0.3em',\n sup: '-0.6em'\n};\n// reset baseline by adding a tspan (empty except for a zero-width space)\n// with dy of -70% * SHIFT_DY (because font-size=70%)\nvar RESET_DY = {\n sub: '-0.21em',\n sup: '0.42em'\n};\nvar ZERO_WIDTH_SPACE = '\\u200b';\n\n/*\n * Whitelist of protocols in user-supplied urls. Mostly we want to avoid javascript\n * and related attack vectors. The empty items are there for IE, that in various\n * versions treats relative paths as having different flavors of no protocol, while\n * other browsers have these explicitly inherit the protocol of the page they're in.\n */\nvar PROTOCOLS = ['http:', 'https:', 'mailto:', '', undefined, ':'];\n\nvar NEWLINES = exports.NEWLINES = /(\\r\\n?|\\n)/g;\n\nvar SPLIT_TAGS = /(<[^<>]*>)/;\n\nvar ONE_TAG = /<(\\/?)([^ >]*)(\\s+(.*))?>/i;\n\nvar BR_TAG = /
/i;\nexports.BR_TAG_ALL = /
/gi;\n\n/*\n * style and href: pull them out of either single or double quotes. Also\n * - target: (_blank|_self|_parent|_top|framename)\n * note that you can't use target to get a popup but if you use popup,\n * a `framename` will be passed along as the name of the popup window.\n * per the spec, cannot contain whitespace.\n * for backward compatibility we default to '_blank'\n * - popup: a custom one for us to enable popup (new window) links. String\n * for window.open -> strWindowFeatures, like 'menubar=yes,width=500,height=550'\n * note that at least in Chrome, you need to give at least one property\n * in this string or the page will open in a new tab anyway. We follow this\n * convention and will not make a popup if this string is empty.\n * per the spec, cannot contain whitespace.\n *\n * Because we hack in other attributes with style (sub & sup), drop any trailing\n * semicolon in user-supplied styles so we can consistently append the tag-dependent style\n *\n * These are for tag attributes; Chrome anyway will convert entities in\n * attribute values, but not in attribute names\n * you can test this by for example:\n * > p = document.createElement('p')\n * > p.innerHTML = 'Hi'\n * > p.innerHTML\n * <- 'Hi'\n */\nvar STYLEMATCH = /(^|[\\s\"'])style\\s*=\\s*(\"([^\"]*);?\"|'([^']*);?')/i;\nvar HREFMATCH = /(^|[\\s\"'])href\\s*=\\s*(\"([^\"]*)\"|'([^']*)')/i;\nvar TARGETMATCH = /(^|[\\s\"'])target\\s*=\\s*(\"([^\"\\s]*)\"|'([^'\\s]*)')/i;\nvar POPUPMATCH = /(^|[\\s\"'])popup\\s*=\\s*(\"([\\w=,]*)\"|'([\\w=,]*)')/i;\n\n// dedicated matcher for these quoted regexes, that can return their results\n// in two different places\nfunction getQuotedMatch(_str, re) {\n if(!_str) return null;\n var match = _str.match(re);\n var result = match && (match[3] || match[4]);\n return result && convertEntities(result);\n}\n\nvar COLORMATCH = /(^|;)\\s*color:/;\n\n/**\n * Strip string of tags\n *\n * @param {string} _str : input string\n * @param {object} opts :\n * - len {number} max length of output string\n * - allowedTags {array} list of pseudo-html tags to NOT strip\n * @return {string}\n */\nexports.plainText = function(_str, opts) {\n opts = opts || {};\n\n var len = (opts.len !== undefined && opts.len !== -1) ? opts.len : Infinity;\n var allowedTags = opts.allowedTags !== undefined ? opts.allowedTags : ['br'];\n\n var ellipsis = '...';\n var eLen = ellipsis.length;\n\n var oldParts = _str.split(SPLIT_TAGS);\n var newParts = [];\n var prevTag = '';\n var l = 0;\n\n for(var i = 0; i < oldParts.length; i++) {\n var p = oldParts[i];\n var match = p.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n\n if(tagType) {\n // N.B. tags do not count towards string length\n if(allowedTags.indexOf(tagType) !== -1) {\n newParts.push(p);\n prevTag = tagType;\n }\n } else {\n var pLen = p.length;\n\n if((l + pLen) < len) {\n newParts.push(p);\n l += pLen;\n } else if(l < len) {\n var pLen2 = len - l;\n\n if(prevTag && (prevTag !== 'br' || pLen2 <= eLen || pLen <= eLen)) {\n newParts.pop();\n }\n\n if(len > eLen) {\n newParts.push(p.substr(0, pLen2 - eLen) + ellipsis);\n } else {\n newParts.push(p.substr(0, pLen2));\n }\n break;\n }\n\n prevTag = '';\n }\n }\n\n return newParts.join('');\n};\n\n/*\n * N.B. HTML entities are listed without the leading '&' and trailing ';'\n * https://www.freeformatter.com/html-entities.html\n *\n * FWIW if we wanted to support the full set, it has 2261 entries:\n * https://www.w3.org/TR/html5/entities.json\n * though I notice that some of these are duplicates and/or are missing \";\"\n * eg: \"&\", \"&\", \"&\", and \"&\" all map to \"&\"\n * We no longer need to include numeric entities here, these are now handled\n * by String.fromCodePoint/fromCharCode\n *\n * Anyway the only ones that are really important to allow are the HTML special\n * chars <, >, and &, because these ones can trigger special processing if not\n * replaced by the corresponding entity.\n */\nvar entityToUnicode = {\n mu: 'μ',\n amp: '&',\n lt: '<',\n gt: '>',\n nbsp: ' ',\n times: '×',\n plusmn: '±',\n deg: '°'\n};\n\n// NOTE: in general entities can contain uppercase too (so [a-zA-Z]) but all the\n// ones we support use only lowercase. If we ever change that, update the regex.\nvar ENTITY_MATCH = /&(#\\d+|#x[\\da-fA-F]+|[a-z]+);/g;\nfunction convertEntities(_str) {\n return _str.replace(ENTITY_MATCH, function(fullMatch, innerMatch) {\n var outChar;\n if(innerMatch.charAt(0) === '#') {\n // cannot use String.fromCodePoint in IE\n outChar = fromCodePoint(\n innerMatch.charAt(1) === 'x' ?\n parseInt(innerMatch.substr(2), 16) :\n parseInt(innerMatch.substr(1), 10)\n );\n } else outChar = entityToUnicode[innerMatch];\n\n // as in regular HTML, if we didn't decode the entity just\n // leave the raw text in place.\n return outChar || fullMatch;\n });\n}\nexports.convertEntities = convertEntities;\n\nfunction fromCodePoint(code) {\n // Don't allow overflow. In Chrome this turns into � but I feel like it's\n // more useful to just not convert it at all.\n if(code > 0x10FFFF) return;\n var stringFromCodePoint = String.fromCodePoint;\n if(stringFromCodePoint) return stringFromCodePoint(code);\n\n // IE doesn't have String.fromCodePoint\n // see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/fromCodePoint\n var stringFromCharCode = String.fromCharCode;\n if(code <= 0xFFFF) return stringFromCharCode(code);\n return stringFromCharCode(\n (code >> 10) + 0xD7C0,\n (code % 0x400) + 0xDC00\n );\n}\n\n/*\n * buildSVGText: convert our pseudo-html into SVG tspan elements, and attach these\n * to containerNode\n *\n * @param {svg text element} containerNode: the node to insert this text into\n * @param {string} str: the pseudo-html string to convert to svg\n *\n * @returns {bool}: does the result contain any links? We need to handle the text element\n * somewhat differently if it does, so just keep track of this when it happens.\n */\nfunction buildSVGText(containerNode, str) {\n /*\n * Normalize behavior between IE and others wrt newlines and whitespace:pre\n * this combination makes IE barf https://github.com/plotly/plotly.js/issues/746\n * Chrome and FF display \\n, \\r, or \\r\\n as a space in this mode.\n * I feel like at some point we turned these into
but currently we don't so\n * I'm just going to cement what we do now in Chrome and FF\n */\n str = str.replace(NEWLINES, ' ');\n\n var hasLink = false;\n\n // as we're building the text, keep track of what elements we're nested inside\n // nodeStack will be an array of {node, type, style, href, target, popup}\n // where only type: 'a' gets the last 3 and node is only added when it's created\n var nodeStack = [];\n var currentNode;\n var currentLine = -1;\n\n function newLine() {\n currentLine++;\n\n var lineNode = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n d3.select(lineNode).attr({\n class: 'line',\n dy: (currentLine * LINE_SPACING) + 'em'\n });\n containerNode.appendChild(lineNode);\n\n currentNode = lineNode;\n\n var oldNodeStack = nodeStack;\n nodeStack = [{node: lineNode}];\n\n if(oldNodeStack.length > 1) {\n for(var i = 1; i < oldNodeStack.length; i++) {\n enterNode(oldNodeStack[i]);\n }\n }\n }\n\n function enterNode(nodeSpec) {\n var type = nodeSpec.type;\n var nodeAttrs = {};\n var nodeType;\n\n if(type === 'a') {\n nodeType = 'a';\n var target = nodeSpec.target;\n var href = nodeSpec.href;\n var popup = nodeSpec.popup;\n if(href) {\n nodeAttrs = {\n 'xlink:xlink:show': (target === '_blank' || target.charAt(0) !== '_') ? 'new' : 'replace',\n target: target,\n 'xlink:xlink:href': href\n };\n if(popup) {\n // security: href and target are not inserted as code but\n // as attributes. popup is, but limited to /[A-Za-z0-9_=,]/\n nodeAttrs.onclick = 'window.open(this.href.baseVal,this.target.baseVal,\"' +\n popup + '\");return false;';\n }\n }\n } else nodeType = 'tspan';\n\n if(nodeSpec.style) nodeAttrs.style = nodeSpec.style;\n\n var newNode = document.createElementNS(xmlnsNamespaces.svg, nodeType);\n\n if(type === 'sup' || type === 'sub') {\n addTextNode(currentNode, ZERO_WIDTH_SPACE);\n currentNode.appendChild(newNode);\n\n var resetter = document.createElementNS(xmlnsNamespaces.svg, 'tspan');\n addTextNode(resetter, ZERO_WIDTH_SPACE);\n d3.select(resetter).attr('dy', RESET_DY[type]);\n nodeAttrs.dy = SHIFT_DY[type];\n\n currentNode.appendChild(newNode);\n currentNode.appendChild(resetter);\n } else {\n currentNode.appendChild(newNode);\n }\n\n d3.select(newNode).attr(nodeAttrs);\n\n currentNode = nodeSpec.node = newNode;\n nodeStack.push(nodeSpec);\n }\n\n function addTextNode(node, text) {\n node.appendChild(document.createTextNode(text));\n }\n\n function exitNode(type) {\n // A bare closing tag can't close the root node. If we encounter this it\n // means there's an extra closing tag that can just be ignored:\n if(nodeStack.length === 1) {\n Lib.log('Ignoring unexpected end tag ' + type + '>.', str);\n return;\n }\n\n var innerNode = nodeStack.pop();\n\n if(type !== innerNode.type) {\n Lib.log('Start tag <' + innerNode.type + '> doesnt match end tag <' +\n type + '>. Pretending it did match.', str);\n }\n currentNode = nodeStack[nodeStack.length - 1].node;\n }\n\n var hasLines = BR_TAG.test(str);\n\n if(hasLines) newLine();\n else {\n currentNode = containerNode;\n nodeStack = [{node: containerNode}];\n }\n\n var parts = str.split(SPLIT_TAGS);\n for(var i = 0; i < parts.length; i++) {\n var parti = parts[i];\n var match = parti.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n var tagStyle = TAG_STYLES[tagType];\n\n if(tagType === 'br') {\n newLine();\n } else if(tagStyle === undefined) {\n addTextNode(currentNode, convertEntities(parti));\n } else {\n // tag - open or close\n if(match[1]) {\n exitNode(tagType);\n } else {\n var extra = match[4];\n\n var nodeSpec = {type: tagType};\n\n // now add style, from both the tag name and any extra css\n // Most of the svg css that users will care about is just like html,\n // but font color is different (uses fill). Let our users ignore this.\n var css = getQuotedMatch(extra, STYLEMATCH);\n if(css) {\n css = css.replace(COLORMATCH, '$1 fill:');\n if(tagStyle) css += ';' + tagStyle;\n } else if(tagStyle) css = tagStyle;\n\n if(css) nodeSpec.style = css;\n\n if(tagType === 'a') {\n hasLink = true;\n\n var href = getQuotedMatch(extra, HREFMATCH);\n\n if(href) {\n var safeHref = sanitizeHref(href);\n if(safeHref) {\n nodeSpec.href = safeHref;\n nodeSpec.target = getQuotedMatch(extra, TARGETMATCH) || '_blank';\n nodeSpec.popup = getQuotedMatch(extra, POPUPMATCH);\n }\n }\n }\n\n enterNode(nodeSpec);\n }\n }\n }\n\n return hasLink;\n}\n\nfunction sanitizeHref(href) {\n var decodedHref = encodeURI(decodeURI(href));\n var dummyAnchor1 = document.createElement('a');\n var dummyAnchor2 = document.createElement('a');\n dummyAnchor1.href = href;\n dummyAnchor2.href = decodedHref;\n\n var p1 = dummyAnchor1.protocol;\n var p2 = dummyAnchor2.protocol;\n\n // check safe protocols\n if(\n PROTOCOLS.indexOf(p1) !== -1 &&\n PROTOCOLS.indexOf(p2) !== -1\n ) {\n return decodedHref;\n } else {\n return '';\n }\n}\n\n/*\n * sanitizeHTML: port of buildSVGText aimed at providing a clean subset of HTML\n * @param {string} str: the html string to clean\n * @returns {string}: a cleaned and normalized version of the input,\n * supporting only a small subset of html\n */\nexports.sanitizeHTML = function sanitizeHTML(str) {\n str = str.replace(NEWLINES, ' ');\n\n var rootNode = document.createElement('p');\n var currentNode = rootNode;\n var nodeStack = [];\n\n var parts = str.split(SPLIT_TAGS);\n for(var i = 0; i < parts.length; i++) {\n var parti = parts[i];\n var match = parti.match(ONE_TAG);\n var tagType = match && match[2].toLowerCase();\n\n if(tagType in TAG_STYLES) {\n if(match[1]) {\n if(nodeStack.length) {\n currentNode = nodeStack.pop();\n }\n } else {\n var extra = match[4];\n\n var css = getQuotedMatch(extra, STYLEMATCH);\n var nodeAttrs = css ? {style: css} : {};\n\n if(tagType === 'a') {\n var href = getQuotedMatch(extra, HREFMATCH);\n\n if(href) {\n var safeHref = sanitizeHref(href);\n if(safeHref) {\n nodeAttrs.href = safeHref;\n var target = getQuotedMatch(extra, TARGETMATCH);\n if(target) {\n nodeAttrs.target = target;\n }\n }\n }\n }\n\n var newNode = document.createElement(tagType);\n currentNode.appendChild(newNode);\n d3.select(newNode).attr(nodeAttrs);\n\n currentNode = newNode;\n nodeStack.push(newNode);\n }\n } else {\n currentNode.appendChild(\n document.createTextNode(convertEntities(parti))\n );\n }\n }\n var key = 'innerHTML'; // i.e. to avoid pass test-syntax\n return rootNode[key];\n};\n\nexports.lineCount = function lineCount(s) {\n return s.selectAll('tspan.line').size() || 1;\n};\n\nexports.positionText = function positionText(s, x, y) {\n return s.each(function() {\n var text = d3.select(this);\n\n function setOrGet(attr, val) {\n if(val === undefined) {\n val = text.attr(attr);\n if(val === null) {\n text.attr(attr, 0);\n val = 0;\n }\n } else text.attr(attr, val);\n return val;\n }\n\n var thisX = setOrGet('x', x);\n var thisY = setOrGet('y', y);\n\n if(this.nodeName === 'text') {\n text.selectAll('tspan.line').attr({x: thisX, y: thisY});\n }\n });\n};\n\nfunction alignHTMLWith(_base, container, options) {\n var alignH = options.horizontalAlign;\n var alignV = options.verticalAlign || 'top';\n var bRect = _base.node().getBoundingClientRect();\n var cRect = container.node().getBoundingClientRect();\n var thisRect;\n var getTop;\n var getLeft;\n\n if(alignV === 'bottom') {\n getTop = function() { return bRect.bottom - thisRect.height; };\n } else if(alignV === 'middle') {\n getTop = function() { return bRect.top + (bRect.height - thisRect.height) / 2; };\n } else { // default: top\n getTop = function() { return bRect.top; };\n }\n\n if(alignH === 'right') {\n getLeft = function() { return bRect.right - thisRect.width; };\n } else if(alignH === 'center') {\n getLeft = function() { return bRect.left + (bRect.width - thisRect.width) / 2; };\n } else { // default: left\n getLeft = function() { return bRect.left; };\n }\n\n return function() {\n thisRect = this.node().getBoundingClientRect();\n\n var x0 = getLeft() - cRect.left;\n var y0 = getTop() - cRect.top;\n var gd = options.gd || {};\n if(options.gd) {\n gd._fullLayout._calcInverseTransform(gd);\n var transformedCoords = Lib.apply3DTransform(gd._fullLayout._invTransform)(x0, y0);\n x0 = transformedCoords[0];\n y0 = transformedCoords[1];\n }\n\n this.style({\n top: y0 + 'px',\n left: x0 + 'px',\n 'z-index': 1000\n });\n return this;\n };\n}\n\nvar onePx = '1px ';\n\nexports.makeTextShadow = function(color) {\n var x = onePx;\n var y = onePx;\n var b = onePx;\n return x + y + b + color + ', ' +\n '-' + x + '-' + y + b + color + ', ' +\n x + '-' + y + b + color + ', ' +\n '-' + x + y + b + color;\n};\n\n/*\n * Editable title\n * @param {d3.selection} context: the element being edited. Normally text,\n * but if it isn't, you should provide the styling options\n * @param {object} options:\n * @param {div} options.gd: graphDiv\n * @param {d3.selection} options.delegate: item to bind events to if not this\n * @param {boolean} options.immediate: start editing now (true) or on click (false, default)\n * @param {string} options.fill: font color if not as shown\n * @param {string} options.background: background color if not as shown\n * @param {string} options.text: initial text, if not as shown\n * @param {string} options.horizontalAlign: alignment of the edit box wrt. the bound element\n * @param {string} options.verticalAlign: alignment of the edit box wrt. the bound element\n */\n\nexports.makeEditable = function(context, options) {\n var gd = options.gd;\n var _delegate = options.delegate;\n var dispatch = d3.dispatch('edit', 'input', 'cancel');\n var handlerElement = _delegate || context;\n\n context.style({'pointer-events': _delegate ? 'none' : 'all'});\n\n if(context.size() !== 1) throw new Error('boo');\n\n function handleClick() {\n appendEditable();\n context.style({opacity: 0});\n // also hide any mathjax svg\n var svgClass = handlerElement.attr('class');\n var mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n }\n\n function selectElementContents(_el) {\n var el = _el.node();\n var range = document.createRange();\n range.selectNodeContents(el);\n var sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n el.focus();\n }\n\n function appendEditable() {\n var plotDiv = d3.select(gd);\n var container = plotDiv.select('.svg-container');\n var div = container.append('div');\n var cStyle = context.node().style;\n var fontSize = parseFloat(cStyle.fontSize || 12);\n\n var initialText = options.text;\n if(initialText === undefined) initialText = context.attr('data-unformatted');\n\n div.classed('plugin-editable editable', true)\n .style({\n position: 'absolute',\n 'font-family': cStyle.fontFamily || 'Arial',\n 'font-size': fontSize,\n color: options.fill || cStyle.fill || 'black',\n opacity: 1,\n 'background-color': options.background || 'transparent',\n outline: '#ffffff33 1px solid',\n margin: [-fontSize / 8 + 1, 0, 0, -1].join('px ') + 'px',\n padding: '0',\n 'box-sizing': 'border-box'\n })\n .attr({contenteditable: true})\n .text(initialText)\n .call(alignHTMLWith(context, container, options))\n .on('blur', function() {\n gd._editing = false;\n context.text(this.textContent)\n .style({opacity: 1});\n var svgClass = d3.select(this).attr('class');\n var mathjaxClass;\n if(svgClass) mathjaxClass = '.' + svgClass.split(' ')[0] + '-math-group';\n else mathjaxClass = '[class*=-math-group]';\n if(mathjaxClass) {\n d3.select(context.node().parentNode).select(mathjaxClass).style({opacity: 0});\n }\n var text = this.textContent;\n d3.select(this).transition().duration(0).remove();\n d3.select(document).on('mouseup', null);\n dispatch.edit.call(context, text);\n })\n .on('focus', function() {\n var editDiv = this;\n gd._editing = true;\n d3.select(document).on('mouseup', function() {\n if(d3.event.target === editDiv) return false;\n if(document.activeElement === div.node()) div.node().blur();\n });\n })\n .on('keyup', function() {\n if(d3.event.which === 27) {\n gd._editing = false;\n context.style({opacity: 1});\n d3.select(this)\n .style({opacity: 0})\n .on('blur', function() { return false; })\n .transition().remove();\n dispatch.cancel.call(context, this.textContent);\n } else {\n dispatch.input.call(context, this.textContent);\n d3.select(this).call(alignHTMLWith(context, container, options));\n }\n })\n .on('keydown', function() {\n if(d3.event.which === 13) this.blur();\n })\n .call(selectElementContents);\n }\n\n if(options.immediate) handleClick();\n else handlerElement.on('click', handleClick);\n\n return d3.rebind(context, dispatch, 'on');\n};\n","'use strict';\n\nvar timerCache = {};\n\n/**\n * Throttle a callback. `callback` executes synchronously only if\n * more than `minInterval` milliseconds have already elapsed since the latest\n * call (if any). Otherwise we wait until `minInterval` is over and execute the\n * last callback received while waiting.\n * So the first and last events in a train are always executed (eventually)\n * but some of the events in the middle can be dropped.\n *\n * @param {string} id: an identifier to mark events to throttle together\n * @param {number} minInterval: minimum time, in milliseconds, between\n * invocations of `callback`\n * @param {function} callback: the function to throttle. `callback` itself\n * should be a purely synchronous function.\n */\nexports.throttle = function throttle(id, minInterval, callback) {\n var cache = timerCache[id];\n var now = Date.now();\n\n if(!cache) {\n /*\n * Throw out old items before making a new one, to prevent the cache\n * getting overgrown, for example from old plots that have been replaced.\n * 1 minute age is arbitrary.\n */\n for(var idi in timerCache) {\n if(timerCache[idi].ts < now - 60000) {\n delete timerCache[idi];\n }\n }\n cache = timerCache[id] = {ts: 0, timer: null};\n }\n\n _clearTimeout(cache);\n\n function exec() {\n callback();\n cache.ts = Date.now();\n if(cache.onDone) {\n cache.onDone();\n cache.onDone = null;\n }\n }\n\n if(now > cache.ts + minInterval) {\n exec();\n return;\n }\n\n cache.timer = setTimeout(function() {\n exec();\n cache.timer = null;\n }, minInterval);\n};\n\nexports.done = function(id) {\n var cache = timerCache[id];\n if(!cache || !cache.timer) return Promise.resolve();\n\n return new Promise(function(resolve) {\n var previousOnDone = cache.onDone;\n cache.onDone = function onDone() {\n if(previousOnDone) previousOnDone();\n resolve();\n cache.onDone = null;\n };\n });\n};\n\n/**\n * Clear the throttle cache for one or all timers\n * @param {optional string} id:\n * if provided, clear just this timer\n * if omitted, clear all timers (mainly useful for testing)\n */\nexports.clear = function(id) {\n if(id) {\n _clearTimeout(timerCache[id]);\n delete timerCache[id];\n } else {\n for(var idi in timerCache) exports.clear(idi);\n }\n};\n\nfunction _clearTimeout(cache) {\n if(cache && cache.timer !== null) {\n clearTimeout(cache.timer);\n cache.timer = null;\n }\n}\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\n/**\n * convert a linear value into a logged value, folding negative numbers into\n * the given range\n */\nmodule.exports = function toLogRange(val, range) {\n if(val > 0) return Math.log(val) / Math.LN10;\n\n // move a negative value reference to a log axis - just put the\n // result at the lowest range value on the plot (or if the range also went negative,\n // one millionth of the top of the range)\n var newVal = Math.log(Math.min(range[0], range[1])) / Math.LN10;\n if(!isNumeric(newVal)) newVal = Math.log(Math.max(range[0], range[1])) / Math.LN10 - 6;\n return newVal;\n};\n","'use strict';\n\nmodule.exports = {\n moduleType: 'locale',\n name: 'en-US',\n dictionary: {\n 'Click to enter Colorscale title': 'Click to enter Colorscale title'\n },\n format: {\n date: '%m/%d/%Y'\n }\n};\n","'use strict';\n\nmodule.exports = {\n moduleType: 'locale',\n name: 'en',\n dictionary: {\n 'Click to enter Colorscale title': 'Click to enter Colourscale title'\n },\n format: {\n days: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],\n shortDays: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n months: [\n 'January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December'\n ],\n shortMonths: [\n 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',\n 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'\n ],\n periods: ['AM', 'PM'],\n dateTime: '%a %b %e %X %Y',\n date: '%d/%m/%Y',\n time: '%H:%M:%S',\n decimal: '.',\n thousands: ',',\n grouping: [3],\n currency: ['$', ''],\n year: '%Y',\n month: '%b %Y',\n dayMonth: '%b %-d',\n dayMonthYear: '%b %-d, %Y'\n }\n};\n"],"names":["isNumeric","require","isArrayOrTypedArray","npGet","cont","parts","curPart","allSame","out","i","j","curCont","length","slice","module","exports","container","propStr","String","substr","indexed","indices","propParts","split","match","splice","Number","set","get","astr","obj","badContainer","npSet","ARGS_PATTERN","isDeletable","val","undefined","propPart","containerLevels","toDelete","setArrayAll","checkNewContainer","joinPropStr","push","Array","isArray","pop","newPart","toAdd","containerArray","innerParts","arrayVal","allSet","thisVal","thisPropStr","replace","deleteThis","firstPart","part","nextPart","d3","NOTEDATA","text","displayLength","indexOf","ts","notifierContainer","select","selectAll","data","enter","append","classed","style","each","thisText","note","this","html","on","transition","call","killNote","p","lines","duration","delay","thisIndex","remove","setCursor","STASHATTR","el3","csr","savedCursor","attr","classes","cls","dot","BADNUM","polygon","tester","ptsIn","pts","xmin","xmax","ymin","ymax","Math","min","max","rectFirstEdgeTest","isRect","pt","degenerate","lastPt","contains","omitFirstEdge","x","y","x0","y0","xmini","ycross","imax","x1","y1","crossings","isSegmentBent","start","end","tolerance","partParallel","startPt","segment","segmentSquared","segmentLen","sqrt","unitPerp","abs","filter","ptsFiltered","doneRawIndex","doneFilteredIndex","addPt","prevFilterLen","iLast","raw","filtered","isMobileOrTablet","opts","ua","hasOwnProperty","userAgent","navigator","headers","getUserAgent","enable","tablet","featureDetect","allParts","k","prevPart","v","array","item","RegExp","itemStr","toString","Lib","dfltConfig","queue","gd","undoFunc","undoArgs","redoFunc","redoArgs","queueObj","queueIndex","undoQueue","index","sequence","autoplay","inSequence","beginSequence","undo","calls","args","redo","unshift","queueLength","shift","isNaN","plotDo","func","arg","copy","extendDeep","extendDeepAll","copyArgArray","apply","counter","head","tail","openEnded","matchBeginning","fullTail","startWithPrefix","ASCEND","SIMPLEATTR","baseAttr","relativeAttr","Error","charAt","isPlainObject","relinkPrivateKeys","toContainer","fromContainer","fromVal","toVal","minLen","Object","keys","loggers","identity","roundingError","lessThan","a","b","lessOrEqual","greaterThan","greaterOrEqual","findBin","bins","linelow","ceil","size","floor","n","test","n1","n2","c","binSize","log","sorterAsc","sorterDes","distinctVals","valsIn","last","vals","sort","preV","minDiff","errDiff","newVals","diff","roundUp","arrayIn","reverse","mid","low","high","dlow","dhigh","rounded","sortFn","notOrdered","notReversed","pairOrder","findIndexOfMin","arr","fn","ind","Infinity","forEach","aggNums","f","len","mean","midRange","numArr","variance","pow","stdev","median","interp","frac","constants","Drawing","_supportsPixelated","unsupportedBrowser","isIE","isSafari","isIOS","window","declarations","from","CSS_DECLARATIONS","supports","CSS","supportsCSS","some","d","image3","STYLE","imageRendering","getComputedStyle","node","value","toLowerCase","strTranslate","xmlnsNamespaces","LINE_SPACING","FIND_TEX","convertToTspans","_context","_callback","str","tex","typesetMath","MathJax","parent","parentNode","empty","svgClass","_promises","Promise","resolve","fontSize","parseInt","config","_texString","_config","originalRenderer","originalConfig","originalProcessSectionDelay","tmpDiv","MathJaxVersion","version","warn","setConfig2","Hub","processSectionDelay","Config","messageStyle","tex2jax","inlineMath","displayAlign","setConfig3","setRenderer2","menuSettings","renderer","setRenderer","setRenderer3","startup","output","initiateMathJax","randomID","randstr","tmpNode","id","visibility","position","LT_MATCH","GT_MATCH","Typeset","typeset","finalizeMathJax","sel","glyphDefs","nodeBBox","getBoundingClientRect","resetRenderer2","resetRenderer3","resetConfig2","resetConfig3","Queue","defaultReady","promise","then","texToSVG","_svgEl","_glyphDefs","_svgBBox","newSvg","showText","mathjaxGroup","appendChild","insertBefore","cloneNode","firstChild","w0","width","h0","height","class","preserveAspectRatio","overflow","fill","g","stroke","bb","w","h","dy","transform","anchor","hasLink","containerNode","NEWLINES","currentNode","nodeStack","currentLine","newLine","lineNode","document","createElementNS","svg","oldNodeStack","enterNode","nodeSpec","nodeType","type","nodeAttrs","target","href","popup","onclick","newNode","addTextNode","ZERO_WIDTH_SPACE","resetter","RESET_DY","SHIFT_DY","createTextNode","exitNode","innerNode","hasLines","BR_TAG","SPLIT_TAGS","parti","ONE_TAG","tagType","tagStyle","TAG_STYLES","convertEntities","extra","css","getQuotedMatch","STYLEMATCH","COLORMATCH","HREFMATCH","safeHref","sanitizeHref","TARGETMATCH","POPUPMATCH","buildSVGText","positionText","sup","sub","span","em","PROTOCOLS","BR_TAG_ALL","_str","re","result","plainText","allowedTags","oldParts","newParts","prevTag","l","pLen","pLen2","ellipsis","join","entityToUnicode","mu","amp","lt","gt","nbsp","times","plusmn","deg","ENTITY_MATCH","fullMatch","innerMatch","code","stringFromCodePoint","fromCodePoint","stringFromCharCode","fromCharCode","decodedHref","encodeURI","decodeURI","dummyAnchor1","createElement","dummyAnchor2","p1","protocol","p2","alignHTMLWith","_base","options","thisRect","getTop","getLeft","alignH","horizontalAlign","alignV","verticalAlign","bRect","cRect","bottom","top","right","left","_fullLayout","_calcInverseTransform","transformedCoords","apply3DTransform","_invTransform","sanitizeHTML","rootNode","lineCount","s","setOrGet","thisX","thisY","nodeName","onePx","makeTextShadow","color","makeEditable","context","_delegate","delegate","dispatch","handlerElement","handleClick","div","cStyle","parseFloat","initialText","fontFamily","opacity","background","outline","margin","padding","contenteditable","_editing","textContent","mathjaxClass","edit","editDiv","event","activeElement","blur","which","cancel","input","selectElementContents","appendEditable","_el","el","range","createRange","selectNodeContents","getSelection","removeAllRanges","addRange","focus","immediate","rebind","timerCache","_clearTimeout","cache","timer","clearTimeout","throttle","minInterval","callback","now","Date","idi","exec","onDone","setTimeout","done","previousOnDone","clear","LN10","newVal","moduleType","name","dictionary","format","date","days","shortDays","months","shortMonths","periods","dateTime","time","decimal","thousands","grouping","currency","year","month","dayMonth","dayMonthYear"],"sourceRoot":""}