\n * or an id to an existing graph
\n * @param {object} opts (see Plotly.toImage in ../plot_api/to_image)\n * @return {promise}\n */\nfunction downloadImage(gd, opts) {\n var _gd;\n if(!Lib.isPlainObject(gd)) _gd = Lib.getGraphDiv(gd);\n\n opts = opts || {};\n opts.format = opts.format || 'png';\n opts.width = opts.width || null;\n opts.height = opts.height || null;\n opts.imageDataOnly = true;\n\n return new Promise(function(resolve, reject) {\n if(_gd && _gd._snapshotInProgress) {\n reject(new Error('Snapshotting already in progress.'));\n }\n\n // see comments within svgtoimg for additional\n // discussion of problems with IE\n // can now draw to canvas, but CORS tainted canvas\n // does not allow toDataURL\n // svg format will work though\n if(Lib.isIE() && opts.format !== 'svg') {\n reject(new Error(helpers.MSG_IE_BAD_FORMAT));\n }\n\n if(_gd) _gd._snapshotInProgress = true;\n var promise = toImage(gd, opts);\n\n var filename = opts.filename || gd.fn || 'newplot';\n filename += '.' + opts.format.replace('-', '.');\n\n promise.then(function(result) {\n if(_gd) _gd._snapshotInProgress = false;\n return fileSaver(result, filename, opts.format);\n }).then(function(name) {\n resolve(name);\n }).catch(function(err) {\n if(_gd) _gd._snapshotInProgress = false;\n reject(err);\n });\n });\n}\n\nmodule.exports = downloadImage;\n","'use strict';\n\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = function(layoutIn, layoutOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n var groupBarmode = layoutOut.barmode === 'group';\n\n if(layoutOut.scattermode === 'group') {\n coerce('scattergap', groupBarmode ? layoutOut.bargap : 0.2);\n }\n};\n","'use strict';\n\nvar Lib = require('../../lib');\nvar Registry = require('../../registry');\n\nmodule.exports = function handleXYDefaults(traceIn, traceOut, layout, coerce) {\n var x = coerce('x');\n var y = coerce('y');\n var len;\n\n var handleCalendarDefaults = Registry.getComponentMethod('calendars', 'handleTraceDefaults');\n handleCalendarDefaults(traceIn, traceOut, ['x', 'y'], layout);\n\n if(x) {\n var xlen = Lib.minRowLength(x);\n if(y) {\n len = Math.min(xlen, Lib.minRowLength(y));\n } else {\n len = xlen;\n coerce('y0');\n coerce('dy');\n }\n } else {\n if(!y) return 0;\n\n len = Lib.minRowLength(y);\n coerce('x0');\n coerce('dx');\n }\n\n traceOut._length = len;\n\n return len;\n};\n","'use strict';\n\nvar getAxisGroup = require('../../plots/cartesian/constraints').getAxisGroup;\n\nmodule.exports = function handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce) {\n var orientation = traceOut.orientation;\n // N.B. grouping is done across all trace types that support it\n var posAxId = traceOut[{v: 'x', h: 'y'}[orientation] + 'axis'];\n var groupId = getAxisGroup(fullLayout, posAxId) + orientation;\n\n var alignmentOpts = fullLayout._alignmentOpts || {};\n var alignmentgroup = coerce('alignmentgroup');\n\n var alignmentGroups = alignmentOpts[groupId];\n if(!alignmentGroups) alignmentGroups = alignmentOpts[groupId] = {};\n\n var alignmentGroupOpts = alignmentGroups[alignmentgroup];\n\n if(alignmentGroupOpts) {\n alignmentGroupOpts.traces.push(traceOut);\n } else {\n alignmentGroupOpts = alignmentGroups[alignmentgroup] = {\n traces: [traceOut],\n alignmentIndex: Object.keys(alignmentGroups).length,\n offsetGroups: {}\n };\n }\n\n var offsetgroup = coerce('offsetgroup');\n var offsetGroups = alignmentGroupOpts.offsetGroups;\n var offsetGroupOpts = offsetGroups[offsetgroup];\n\n if(offsetgroup) {\n if(!offsetGroupOpts) {\n offsetGroupOpts = offsetGroups[offsetgroup] = {\n offsetIndex: Object.keys(offsetGroups).length\n };\n }\n\n traceOut._offsetIndex = offsetGroupOpts.offsetIndex;\n }\n};\n","'use strict';\n\nvar maxRowLength = require('../../lib').maxRowLength;\n\n/* Return a list of empty points in 2D array z\n * each empty point z[i][j] gives an array [i, j, neighborCount]\n * neighborCount is the count of 4 nearest neighbors that DO exist\n * this is to give us an order of points to evaluate for interpolation.\n * if no neighbors exist, we iteratively look for neighbors that HAVE\n * neighbors, and add a fractional neighborCount\n */\nmodule.exports = function findEmpties(z) {\n var empties = [];\n var neighborHash = {};\n var noNeighborList = [];\n var nextRow = z[0];\n var row = [];\n var blank = [0, 0, 0];\n var rowLength = maxRowLength(z);\n var prevRow;\n var i;\n var j;\n var thisPt;\n var p;\n var neighborCount;\n var newNeighborHash;\n var foundNewNeighbors;\n\n for(i = 0; i < z.length; i++) {\n prevRow = row;\n row = nextRow;\n nextRow = z[i + 1] || [];\n for(j = 0; j < rowLength; j++) {\n if(row[j] === undefined) {\n neighborCount = (row[j - 1] !== undefined ? 1 : 0) +\n (row[j + 1] !== undefined ? 1 : 0) +\n (prevRow[j] !== undefined ? 1 : 0) +\n (nextRow[j] !== undefined ? 1 : 0);\n\n if(neighborCount) {\n // for this purpose, don't count off-the-edge points\n // as undefined neighbors\n if(i === 0) neighborCount++;\n if(j === 0) neighborCount++;\n if(i === z.length - 1) neighborCount++;\n if(j === row.length - 1) neighborCount++;\n\n // if all neighbors that could exist do, we don't\n // need this for finding farther neighbors\n if(neighborCount < 4) {\n neighborHash[[i, j]] = [i, j, neighborCount];\n }\n\n empties.push([i, j, neighborCount]);\n } else noNeighborList.push([i, j]);\n }\n }\n }\n\n while(noNeighborList.length) {\n newNeighborHash = {};\n foundNewNeighbors = false;\n\n // look for cells that now have neighbors but didn't before\n for(p = noNeighborList.length - 1; p >= 0; p--) {\n thisPt = noNeighborList[p];\n i = thisPt[0];\n j = thisPt[1];\n\n neighborCount = ((neighborHash[[i - 1, j]] || blank)[2] +\n (neighborHash[[i + 1, j]] || blank)[2] +\n (neighborHash[[i, j - 1]] || blank)[2] +\n (neighborHash[[i, j + 1]] || blank)[2]) / 20;\n\n if(neighborCount) {\n newNeighborHash[thisPt] = [i, j, neighborCount];\n noNeighborList.splice(p, 1);\n foundNewNeighbors = true;\n }\n }\n\n if(!foundNewNeighbors) {\n throw 'findEmpties iterated with no new neighbors';\n }\n\n // put these new cells into the main neighbor list\n for(thisPt in newNeighborHash) {\n neighborHash[thisPt] = newNeighborHash[thisPt];\n empties.push(newNeighborHash[thisPt]);\n }\n }\n\n // sort the full list in descending order of neighbor count\n return empties.sort(function(a, b) { return b[2] - a[2]; });\n};\n","'use strict';\n\nmodule.exports = {\n PTS_LINESONLY: 20,\n\n // fixed parameters of clustering and clipping algorithms\n\n // fraction of clustering tolerance \"so close we don't even consider it a new point\"\n minTolerance: 0.2,\n // how fast does clustering tolerance increase as you get away from the visible region\n toleranceGrowth: 10,\n\n // number of viewport sizes away from the visible region\n // at which we clip all lines to the perimeter\n maxScreensAway: 20,\n\n eventDataKeys: []\n};\n","// ray-casting algorithm based on\n// https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html\n\nmodule.exports = function pointInPolygonNested (point, vs, start, end) {\n var x = point[0], y = point[1];\n var inside = false;\n if (start === undefined) start = 0;\n if (end === undefined) end = vs.length;\n var len = end - start;\n for (var i = 0, j = len - 1; i < len; j = i++) {\n var xi = vs[i+start][0], yi = vs[i+start][1];\n var xj = vs[j+start][0], yj = vs[j+start][1];\n var intersect = ((yi > y) !== (yj > y))\n && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n if (intersect) inside = !inside;\n }\n return inside;\n};\n","'use strict';\n\nvar subtypes = require('./subtypes');\n\nmodule.exports = function selectPoints(searchInfo, selectionTester) {\n var cd = searchInfo.cd;\n var xa = searchInfo.xaxis;\n var ya = searchInfo.yaxis;\n var selection = [];\n var trace = cd[0].trace;\n var i;\n var di;\n var x;\n var y;\n\n var hasOnlyLines = (!subtypes.hasMarkers(trace) && !subtypes.hasText(trace));\n if(hasOnlyLines) return [];\n\n if(selectionTester === false) { // clear selection\n for(i = 0; i < cd.length; i++) {\n cd[i].selected = 0;\n }\n } else {\n for(i = 0; i < cd.length; i++) {\n di = cd[i];\n x = xa.c2p(di.x);\n y = ya.c2p(di.y);\n\n if((di.i !== null) && selectionTester.contains([x, y], false, i, searchInfo)) {\n selection.push({\n pointNumber: di.i,\n x: xa.c2d(di.x),\n y: ya.c2d(di.y)\n });\n di.selected = 1;\n } else {\n di.selected = 0;\n }\n }\n }\n\n return selection;\n};\n","'use strict';\n\nvar Registry = require('../../registry');\nvar Axes = require('../../plots/cartesian/axes');\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\nvar validateCornerradius = require('./defaults').validateCornerradius;\n\n\nmodule.exports = function(layoutIn, layoutOut, fullData) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n var hasBars = false;\n var shouldBeGapless = false;\n var gappedAnyway = false;\n var usedSubplots = {};\n\n var mode = coerce('barmode');\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n if(Registry.traceIs(trace, 'bar') && trace.visible) hasBars = true;\n else continue;\n\n // if we have at least 2 grouped bar traces on the same subplot,\n // we should default to a gap anyway, even if the data is histograms\n if(mode === 'group') {\n var subploti = trace.xaxis + trace.yaxis;\n if(usedSubplots[subploti]) gappedAnyway = true;\n usedSubplots[subploti] = true;\n }\n\n if(trace.visible && trace.type === 'histogram') {\n var pa = Axes.getFromId({_fullLayout: layoutOut},\n trace[trace.orientation === 'v' ? 'xaxis' : 'yaxis']);\n if(pa.type !== 'category') shouldBeGapless = true;\n }\n }\n\n if(!hasBars) {\n delete layoutOut.barmode;\n return;\n }\n\n if(mode !== 'overlay') coerce('barnorm');\n\n coerce('bargap', (shouldBeGapless && !gappedAnyway) ? 0 : 0.2);\n coerce('bargroupgap');\n var r = coerce('barcornerradius');\n layoutOut.barcornerradius = validateCornerradius(r);\n};\n","'use strict';\n\nvar EventEmitter = require('events').EventEmitter;\n\nvar Registry = require('../registry');\nvar Lib = require('../lib');\n\nvar helpers = require('./helpers');\nvar clonePlot = require('./cloneplot');\nvar toSVG = require('./tosvg');\nvar svgToImg = require('./svgtoimg');\n\n/**\n * @param {object} gd figure Object\n * @param {object} opts option object\n * @param opts.format 'jpeg' | 'png' | 'webp' | 'svg'\n */\nfunction toImage(gd, opts) {\n // first clone the GD so we can operate in a clean environment\n var ev = new EventEmitter();\n\n var clone = clonePlot(gd, {format: 'png'});\n var clonedGd = clone.gd;\n\n // put the cloned div somewhere off screen before attaching to DOM\n clonedGd.style.position = 'absolute';\n clonedGd.style.left = '-5000px';\n document.body.appendChild(clonedGd);\n\n function wait() {\n var delay = helpers.getDelay(clonedGd._fullLayout);\n\n setTimeout(function() {\n var svg = toSVG(clonedGd);\n\n var canvas = document.createElement('canvas');\n canvas.id = Lib.randstr();\n\n ev = svgToImg({\n format: opts.format,\n width: clonedGd._fullLayout.width,\n height: clonedGd._fullLayout.height,\n canvas: canvas,\n emitter: ev,\n svg: svg\n });\n\n ev.clean = function() {\n if(clonedGd) document.body.removeChild(clonedGd);\n };\n }, delay);\n }\n\n var redrawFunc = helpers.getRedrawFunc(clonedGd);\n\n Registry.call('_doPlot', clonedGd, clone.data, clone.layout, clone.config)\n .then(redrawFunc)\n .then(wait)\n .catch(function(err) {\n ev.emit('error', err);\n });\n\n\n return ev;\n}\n\nmodule.exports = toImage;\n","'use strict';\n\nvar Color = require('../../components/color');\nvar subtypes = require('./subtypes');\n\n\nmodule.exports = function getTraceColor(trace, di) {\n var lc, tc;\n\n // TODO: text modes\n\n if(trace.mode === 'lines') {\n lc = trace.line.color;\n return (lc && Color.opacity(lc)) ?\n lc : trace.fillcolor;\n } else if(trace.mode === 'none') {\n return trace.fill ? trace.fillcolor : '';\n } else {\n var mc = di.mcc || (trace.marker || {}).color;\n var mlc = di.mlcc || ((trace.marker || {}).line || {}).color;\n\n tc = (mc && Color.opacity(mc)) ? mc :\n (mlc && Color.opacity(mlc) &&\n (di.mlw || ((trace.marker || {}).line || {}).width)) ? mlc : '';\n\n if(tc) {\n // make sure the points aren't TOO transparent\n if(Color.opacity(tc) < 0.3) {\n return Color.addOpacity(tc, 0.3);\n } else return tc;\n } else {\n lc = (trace.line || {}).color;\n return (lc && Color.opacity(lc) &&\n subtypes.hasLines(trace) && trace.line.width) ?\n lc : trace.fillcolor;\n }\n }\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar tinycolor = require('tinycolor2');\n\nvar Color = require('../../components/color');\n\nvar extendedColorWayList = {};\n\nfunction calc(gd, trace) {\n var cd = [];\n\n var fullLayout = gd._fullLayout;\n var hiddenLabels = fullLayout.hiddenlabels || [];\n\n var labels = trace.labels;\n var colors = trace.marker.colors || [];\n var vals = trace.values;\n var len = trace._length;\n var hasValues = trace._hasValues && len;\n\n var i, pt;\n\n if(trace.dlabel) {\n labels = new Array(len);\n for(i = 0; i < len; i++) {\n labels[i] = String(trace.label0 + i * trace.dlabel);\n }\n }\n\n var allThisTraceLabels = {};\n var pullColor = makePullColorFn(fullLayout['_' + trace.type + 'colormap']);\n var vTotal = 0;\n var isAggregated = false;\n\n for(i = 0; i < len; i++) {\n var v, label, hidden;\n if(hasValues) {\n v = vals[i];\n if(!isNumeric(v)) continue;\n v = +v;\n } else v = 1;\n\n label = labels[i];\n if(label === undefined || label === '') label = i;\n label = String(label);\n\n var thisLabelIndex = allThisTraceLabels[label];\n if(thisLabelIndex === undefined) {\n allThisTraceLabels[label] = cd.length;\n\n hidden = hiddenLabels.indexOf(label) !== -1;\n\n if(!hidden) vTotal += v;\n\n cd.push({\n v: v,\n label: label,\n color: pullColor(colors[i], label),\n i: i,\n pts: [i],\n hidden: hidden\n });\n } else {\n isAggregated = true;\n\n pt = cd[thisLabelIndex];\n pt.v += v;\n pt.pts.push(i);\n if(!pt.hidden) vTotal += v;\n\n if(pt.color === false && colors[i]) {\n pt.color = pullColor(colors[i], label);\n }\n }\n }\n\n // Drop aggregate sums of value 0 or less\n cd = cd.filter(function(elem) { return elem.v >= 0; });\n\n var shouldSort = (trace.type === 'funnelarea') ? isAggregated : trace.sort;\n if(shouldSort) cd.sort(function(a, b) { return b.v - a.v; });\n\n // include the sum of all values in the first point\n if(cd[0]) cd[0].vTotal = vTotal;\n\n return cd;\n}\n\nfunction makePullColorFn(colorMap) {\n return function pullColor(color, id) {\n if(!color) return false;\n\n color = tinycolor(color);\n if(!color.isValid()) return false;\n\n color = Color.addOpacity(color, color.getAlpha());\n if(!colorMap[id]) colorMap[id] = color;\n\n return color;\n };\n}\n\n/*\n * `calc` filled in (and collated) explicit colors.\n * Now we need to propagate these explicit colors to other traces,\n * and fill in default colors.\n * This is done after sorting, so we pick defaults\n * in the order slices will be displayed\n */\nfunction crossTraceCalc(gd, plotinfo) { // TODO: should we name the second argument opts?\n var desiredType = (plotinfo || {}).type;\n if(!desiredType) desiredType = 'pie';\n\n var fullLayout = gd._fullLayout;\n var calcdata = gd.calcdata;\n var colorWay = fullLayout[desiredType + 'colorway'];\n var colorMap = fullLayout['_' + desiredType + 'colormap'];\n\n if(fullLayout['extend' + desiredType + 'colors']) {\n colorWay = generateExtendedColors(colorWay, extendedColorWayList);\n }\n var dfltColorCount = 0;\n\n for(var i = 0; i < calcdata.length; i++) {\n var cd = calcdata[i];\n var traceType = cd[0].trace.type;\n if(traceType !== desiredType) continue;\n\n for(var j = 0; j < cd.length; j++) {\n var pt = cd[j];\n if(pt.color === false) {\n // have we seen this label and assigned a color to it in a previous trace?\n if(colorMap[pt.label]) {\n pt.color = colorMap[pt.label];\n } else {\n colorMap[pt.label] = pt.color = colorWay[dfltColorCount % colorWay.length];\n dfltColorCount++;\n }\n }\n }\n }\n}\n\n/**\n * pick a default color from the main default set, augmented by\n * itself lighter then darker before repeating\n */\nfunction generateExtendedColors(colorList, extendedColorWays) {\n var i;\n var colorString = JSON.stringify(colorList);\n var colors = extendedColorWays[colorString];\n if(!colors) {\n colors = colorList.slice();\n\n for(i = 0; i < colorList.length; i++) {\n colors.push(tinycolor(colorList[i]).lighten(20).toHexString());\n }\n\n for(i = 0; i < colorList.length; i++) {\n colors.push(tinycolor(colorList[i]).darken(20).toHexString());\n }\n extendedColorWays[colorString] = colors;\n }\n\n return colors;\n}\n\nmodule.exports = {\n calc: calc,\n crossTraceCalc: crossTraceCalc,\n\n makePullColorFn: makePullColorFn,\n generateExtendedColors: generateExtendedColors\n};\n","'use strict';\n\nvar Lib = require('../../lib');\n\nvar layoutAttributes = require('./layout_attributes');\n\nmodule.exports = function supplyLayoutDefaults(layoutIn, layoutOut) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n\n coerce('hiddenlabels');\n coerce('piecolorway', layoutOut.colorway);\n coerce('extendpiecolors');\n};\n","'use strict';\n\nvar baseAttrs = require('../../plots/attributes');\nvar domainAttrs = require('../../plots/domain').attributes;\nvar fontAttrs = require('../../plots/font_attributes');\nvar colorAttrs = require('../../components/color/attributes');\nvar hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;\n\nvar extendFlat = require('../../lib/extend').extendFlat;\nvar pattern = require('../../components/drawing/attributes').pattern;\n\nvar textFontAttrs = fontAttrs({\n editType: 'plot',\n arrayOk: true,\n colorEditType: 'plot',\n description: 'Sets the font used for `textinfo`.'\n});\n\nmodule.exports = {\n labels: {\n valType: 'data_array',\n editType: 'calc',\n description: [\n 'Sets the sector labels.',\n 'If `labels` entries are duplicated, we sum associated `values`',\n 'or simply count occurrences if `values` is not provided.',\n 'For other array attributes (including color) we use the first',\n 'non-empty entry among all occurrences of the label.'\n ].join(' ')\n },\n // equivalent of x0 and dx, if label is missing\n label0: {\n valType: 'number',\n dflt: 0,\n editType: 'calc',\n description: [\n 'Alternate to `labels`.',\n 'Builds a numeric set of labels.',\n 'Use with `dlabel`',\n 'where `label0` is the starting label and `dlabel` the step.'\n ].join(' ')\n },\n dlabel: {\n valType: 'number',\n dflt: 1,\n editType: 'calc',\n description: 'Sets the label step. See `label0` for more info.'\n },\n\n values: {\n valType: 'data_array',\n editType: 'calc',\n description: [\n 'Sets the values of the sectors.',\n 'If omitted, we count occurrences of each label.'\n ].join(' ')\n },\n\n marker: {\n colors: {\n valType: 'data_array', // TODO 'color_array' ?\n editType: 'calc',\n description: [\n 'Sets the color of each sector.',\n 'If not specified, the default trace color set is used',\n 'to pick the sector colors.'\n ].join(' ')\n },\n\n line: {\n color: {\n valType: 'color',\n dflt: colorAttrs.defaultLine,\n arrayOk: true,\n editType: 'style',\n description: [\n 'Sets the color of the line enclosing each sector.'\n ].join(' ')\n },\n width: {\n valType: 'number',\n min: 0,\n dflt: 0,\n arrayOk: true,\n editType: 'style',\n description: [\n 'Sets the width (in px) of the line enclosing each sector.'\n ].join(' ')\n },\n editType: 'calc'\n },\n pattern: pattern,\n editType: 'calc'\n },\n\n text: {\n valType: 'data_array',\n editType: 'plot',\n description: [\n 'Sets text elements associated with each sector.',\n 'If trace `textinfo` contains a *text* flag, these elements will be seen',\n 'on the chart.',\n 'If trace `hoverinfo` contains a *text* flag and *hovertext* is not set,',\n 'these elements will be seen in the hover labels.'\n ].join(' ')\n },\n hovertext: {\n valType: 'string',\n dflt: '',\n arrayOk: true,\n editType: 'style',\n description: [\n 'Sets hover text elements associated with each sector.',\n 'If a single string, the same string appears for',\n 'all data points.',\n 'If an array of string, the items are mapped in order of',\n 'this trace\\'s sectors.',\n 'To be seen, trace `hoverinfo` must contain a *text* flag.'\n ].join(' ')\n },\n\n// 'see eg:'\n// 'https://www.e-education.psu.edu/natureofgeoinfo/sites/www.e-education.psu.edu.natureofgeoinfo/files/image/hisp_pies.gif',\n// '(this example involves a map too - may someday be a whole trace type',\n// 'of its own. but the point is the size of the whole pie is important.)'\n scalegroup: {\n valType: 'string',\n dflt: '',\n editType: 'calc',\n description: [\n 'If there are multiple pie charts that should be sized according to',\n 'their totals, link them by providing a non-empty group id here',\n 'shared by every trace in the same group.'\n ].join(' ')\n },\n\n // labels (legend is handled by plots.attributes.showlegend and layout.hiddenlabels)\n textinfo: {\n valType: 'flaglist',\n flags: ['label', 'text', 'value', 'percent'],\n extras: ['none'],\n editType: 'calc',\n description: [\n 'Determines which trace information appear on the graph.'\n ].join(' ')\n },\n hoverinfo: extendFlat({}, baseAttrs.hoverinfo, {\n flags: ['label', 'text', 'value', 'percent', 'name']\n }),\n hovertemplate: hovertemplateAttrs({}, {\n keys: ['label', 'color', 'value', 'percent', 'text']\n }),\n texttemplate: texttemplateAttrs({editType: 'plot'}, {\n keys: ['label', 'color', 'value', 'percent', 'text']\n }),\n textposition: {\n valType: 'enumerated',\n values: ['inside', 'outside', 'auto', 'none'],\n dflt: 'auto',\n arrayOk: true,\n editType: 'plot',\n description: [\n 'Specifies the location of the `textinfo`.'\n ].join(' ')\n },\n textfont: extendFlat({}, textFontAttrs, {\n description: 'Sets the font used for `textinfo`.'\n }),\n insidetextorientation: {\n valType: 'enumerated',\n values: ['horizontal', 'radial', 'tangential', 'auto'],\n dflt: 'auto',\n editType: 'plot',\n description: [\n 'Controls the orientation of the text inside chart sectors.',\n 'When set to *auto*, text may be oriented in any direction in order',\n 'to be as big as possible in the middle of a sector.',\n 'The *horizontal* option orients text to be parallel with the bottom',\n 'of the chart, and may make text smaller in order to achieve that goal.',\n 'The *radial* option orients text along the radius of the sector.',\n 'The *tangential* option orients text perpendicular to the radius of the sector.'\n ].join(' ')\n },\n insidetextfont: extendFlat({}, textFontAttrs, {\n description: 'Sets the font used for `textinfo` lying inside the sector.'\n }),\n outsidetextfont: extendFlat({}, textFontAttrs, {\n description: 'Sets the font used for `textinfo` lying outside the sector.'\n }),\n automargin: {\n valType: 'boolean',\n dflt: false,\n editType: 'plot',\n description: [\n 'Determines whether outside text labels can push the margins.'\n ].join(' ')\n },\n\n title: {\n text: {\n valType: 'string',\n dflt: '',\n editType: 'plot',\n description: [\n 'Sets the title of the chart.',\n 'If it is empty, no title is displayed.',\n 'Note that before the existence of `title.text`, the title\\'s',\n 'contents used to be defined as the `title` attribute itself.',\n 'This behavior has been deprecated.'\n ].join(' ')\n },\n font: extendFlat({}, textFontAttrs, {\n description: [\n 'Sets the font used for `title`.',\n 'Note that the title\\'s font used to be set',\n 'by the now deprecated `titlefont` attribute.'\n ].join(' ')\n }),\n position: {\n valType: 'enumerated',\n values: [\n 'top left', 'top center', 'top right',\n 'middle center',\n 'bottom left', 'bottom center', 'bottom right'\n ],\n editType: 'plot',\n description: [\n 'Specifies the location of the `title`.',\n 'Note that the title\\'s position used to be set',\n 'by the now deprecated `titleposition` attribute.'\n ].join(' ')\n },\n\n editType: 'plot'\n },\n\n // position and shape\n domain: domainAttrs({name: 'pie', trace: true, editType: 'calc'}),\n\n hole: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n editType: 'calc',\n description: [\n 'Sets the fraction of the radius to cut out of the pie.',\n 'Use this to make a donut chart.'\n ].join(' ')\n },\n\n // ordering and direction\n sort: {\n valType: 'boolean',\n dflt: true,\n editType: 'calc',\n description: [\n 'Determines whether or not the sectors are reordered',\n 'from largest to smallest.'\n ].join(' ')\n },\n direction: {\n /**\n * there are two common conventions, both of which place the first\n * (largest, if sorted) slice with its left edge at 12 o'clock but\n * succeeding slices follow either cw or ccw from there.\n *\n * see http://visage.co/data-visualization-101-pie-charts/\n */\n valType: 'enumerated',\n values: ['clockwise', 'counterclockwise'],\n dflt: 'counterclockwise',\n editType: 'calc',\n description: [\n 'Specifies the direction at which succeeding sectors follow',\n 'one another.'\n ].join(' ')\n },\n rotation: {\n valType: 'angle',\n dflt: 0,\n editType: 'calc',\n description: [\n 'Instead of the first slice starting at 12 o\\'clock,',\n 'rotate to some other angle.'\n ].join(' ')\n },\n\n pull: {\n valType: 'number',\n min: 0,\n max: 1,\n dflt: 0,\n arrayOk: true,\n editType: 'calc',\n description: [\n 'Sets the fraction of larger radius to pull the sectors',\n 'out from the center. This can be a constant',\n 'to pull all slices apart from each other equally',\n 'or an array to highlight one or more slices.'\n ].join(' ')\n },\n\n _deprecated: {\n title: {\n valType: 'string',\n dflt: '',\n editType: 'calc',\n description: [\n 'Deprecated in favor of `title.text`.',\n 'Note that value of `title` is no longer a simple',\n '*string* but a set of sub-attributes.'\n ].join(' ')\n },\n titlefont: extendFlat({}, textFontAttrs, {\n description: 'Deprecated in favor of `title.font`.'\n }),\n titleposition: {\n valType: 'enumerated',\n values: [\n 'top left', 'top center', 'top right',\n 'middle center',\n 'bottom left', 'bottom center', 'bottom right'\n ],\n editType: 'calc',\n description: 'Deprecated in favor of `title.position`.'\n }\n }\n};\n","'use strict';\n\nvar d3 = require('@plotly/d3');\n\nvar Lib = require('../../lib');\nvar Drawing = require('../../components/drawing');\n\n// constants for dynamic jitter (ie less jitter for sparser points)\nvar JITTERCOUNT = 5; // points either side of this to include\nvar JITTERSPREAD = 0.01; // fraction of IQR to count as \"dense\"\n\nfunction plot(gd, plotinfo, cdbox, boxLayer) {\n var isStatic = gd._context.staticPlot;\n var xa = plotinfo.xaxis;\n var ya = plotinfo.yaxis;\n\n Lib.makeTraceGroups(boxLayer, cdbox, 'trace boxes').each(function(cd) {\n var plotGroup = d3.select(this);\n var cd0 = cd[0];\n var t = cd0.t;\n var trace = cd0.trace;\n\n // whisker width\n t.wdPos = t.bdPos * trace.whiskerwidth;\n\n if(trace.visible !== true || t.empty) {\n plotGroup.remove();\n return;\n }\n\n var posAxis, valAxis;\n\n if(trace.orientation === 'h') {\n posAxis = ya;\n valAxis = xa;\n } else {\n posAxis = xa;\n valAxis = ya;\n }\n\n plotBoxAndWhiskers(plotGroup, {pos: posAxis, val: valAxis}, trace, t, isStatic);\n plotPoints(plotGroup, {x: xa, y: ya}, trace, t);\n plotBoxMean(plotGroup, {pos: posAxis, val: valAxis}, trace, t);\n });\n}\n\nfunction plotBoxAndWhiskers(sel, axes, trace, t, isStatic) {\n var isHorizontal = trace.orientation === 'h';\n var valAxis = axes.val;\n var posAxis = axes.pos;\n var posHasRangeBreaks = !!posAxis.rangebreaks;\n\n var bPos = t.bPos;\n var wdPos = t.wdPos || 0;\n var bPosPxOffset = t.bPosPxOffset || 0;\n var whiskerWidth = trace.whiskerwidth || 0;\n var showWhiskers = (trace.showwhiskers !== false);\n var notched = trace.notched || false;\n var nw = notched ? 1 - 2 * trace.notchwidth : 1;\n\n // to support for one-sided box\n var bdPos0;\n var bdPos1;\n if(Array.isArray(t.bdPos)) {\n bdPos0 = t.bdPos[0];\n bdPos1 = t.bdPos[1];\n } else {\n bdPos0 = t.bdPos;\n bdPos1 = t.bdPos;\n }\n\n var paths = sel.selectAll('path.box').data((\n trace.type !== 'violin' ||\n trace.box.visible\n ) ? Lib.identity : []);\n\n paths.enter().append('path')\n .style('vector-effect', isStatic ? 'none' : 'non-scaling-stroke')\n .attr('class', 'box');\n\n paths.exit().remove();\n\n paths.each(function(d) {\n if(d.empty) return d3.select(this).attr('d', 'M0,0Z');\n\n var lcenter = posAxis.c2l(d.pos + bPos, true);\n\n var pos0 = posAxis.l2p(lcenter - bdPos0) + bPosPxOffset;\n var pos1 = posAxis.l2p(lcenter + bdPos1) + bPosPxOffset;\n var posc = posHasRangeBreaks ? (pos0 + pos1) / 2 : posAxis.l2p(lcenter) + bPosPxOffset;\n\n var r = trace.whiskerwidth;\n var posw0 = posHasRangeBreaks ? pos0 * r + (1 - r) * posc : posAxis.l2p(lcenter - wdPos) + bPosPxOffset;\n var posw1 = posHasRangeBreaks ? pos1 * r + (1 - r) * posc : posAxis.l2p(lcenter + wdPos) + bPosPxOffset;\n\n var posm0 = posAxis.l2p(lcenter - bdPos0 * nw) + bPosPxOffset;\n var posm1 = posAxis.l2p(lcenter + bdPos1 * nw) + bPosPxOffset;\n var sdmode = trace.sizemode === 'sd';\n var q1 = valAxis.c2p(sdmode ? d.mean - d.sd : d.q1, true);\n var q3 = sdmode ? valAxis.c2p(d.mean + d.sd, true) :\n valAxis.c2p(d.q3, true);\n // make sure median isn't identical to either of the\n // quartiles, so we can see it\n var m = Lib.constrain(\n sdmode ? valAxis.c2p(d.mean, true) :\n valAxis.c2p(d.med, true),\n Math.min(q1, q3) + 1, Math.max(q1, q3) - 1\n );\n\n // for compatibility with box, violin, and candlestick\n // perhaps we should put this into cd0.t instead so it's more explicit,\n // but what we have now is:\n // - box always has d.lf, but boxpoints can be anything\n // - violin has d.lf and should always use it (boxpoints is undefined)\n // - candlestick has only min/max\n var useExtremes = (d.lf === undefined) || (trace.boxpoints === false) || sdmode;\n var lf = valAxis.c2p(useExtremes ? d.min : d.lf, true);\n var uf = valAxis.c2p(useExtremes ? d.max : d.uf, true);\n var ln = valAxis.c2p(d.ln, true);\n var un = valAxis.c2p(d.un, true);\n\n if(isHorizontal) {\n d3.select(this).attr('d',\n 'M' + m + ',' + posm0 + 'V' + posm1 + // median line\n 'M' + q1 + ',' + pos0 + 'V' + pos1 + // left edge\n (notched ?\n 'H' + ln + 'L' + m + ',' + posm1 + 'L' + un + ',' + pos1 :\n ''\n ) + // top notched edge\n 'H' + q3 + // end of the top edge\n 'V' + pos0 + // right edge\n (notched ? 'H' + un + 'L' + m + ',' + posm0 + 'L' + ln + ',' + pos0 : '') + // bottom notched edge\n 'Z' + // end of the box\n (showWhiskers ?\n 'M' + q1 + ',' + posc + 'H' + lf + 'M' + q3 + ',' + posc + 'H' + uf + // whiskers\n (whiskerWidth === 0 ?\n '' : // whisker caps\n 'M' + lf + ',' + posw0 + 'V' + posw1 + 'M' + uf + ',' + posw0 + 'V' + posw1\n ) :\n ''\n )\n );\n } else {\n d3.select(this).attr('d',\n 'M' + posm0 + ',' + m + 'H' + posm1 + // median line\n 'M' + pos0 + ',' + q1 + 'H' + pos1 + // top of the box\n (notched ?\n 'V' + ln + 'L' + posm1 + ',' + m + 'L' + pos1 + ',' + un :\n ''\n ) + // notched right edge\n 'V' + q3 + // end of the right edge\n 'H' + pos0 + // bottom of the box\n (notched ?\n 'V' + un + 'L' + posm0 + ',' + m + 'L' + pos0 + ',' + ln :\n ''\n ) + // notched left edge\n 'Z' + // end of the box\n (showWhiskers ?\n 'M' + posc + ',' + q1 + 'V' + lf + 'M' + posc + ',' + q3 + 'V' + uf + // whiskers\n (whiskerWidth === 0 ?\n '' : // whisker caps\n 'M' + posw0 + ',' + lf + 'H' + posw1 + 'M' + posw0 + ',' + uf + 'H' + posw1\n ) :\n ''\n )\n );\n }\n });\n}\n\nfunction plotPoints(sel, axes, trace, t) {\n var xa = axes.x;\n var ya = axes.y;\n var bdPos = t.bdPos;\n var bPos = t.bPos;\n\n // to support violin points\n var mode = trace.boxpoints || trace.points;\n\n // repeatable pseudo-random number generator\n Lib.seedPseudoRandom();\n\n // since box plot points get an extra level of nesting, each\n // box needs the trace styling info\n var fn = function(d) {\n d.forEach(function(v) {\n v.t = t;\n v.trace = trace;\n });\n return d;\n };\n\n var gPoints = sel.selectAll('g.points')\n .data(mode ? fn : []);\n\n gPoints.enter().append('g')\n .attr('class', 'points');\n\n gPoints.exit().remove();\n\n var paths = gPoints.selectAll('path')\n .data(function(d) {\n var i;\n var pts = d.pts2;\n\n // normally use IQR, but if this is 0 or too small, use max-min\n var typicalSpread = Math.max((d.max - d.min) / 10, d.q3 - d.q1);\n var minSpread = typicalSpread * 1e-9;\n var spreadLimit = typicalSpread * JITTERSPREAD;\n var jitterFactors = [];\n var maxJitterFactor = 0;\n var newJitter;\n\n // dynamic jitter\n if(trace.jitter) {\n if(typicalSpread === 0) {\n // edge case of no spread at all: fall back to max jitter\n maxJitterFactor = 1;\n jitterFactors = new Array(pts.length);\n for(i = 0; i < pts.length; i++) {\n jitterFactors[i] = 1;\n }\n } else {\n for(i = 0; i < pts.length; i++) {\n var i0 = Math.max(0, i - JITTERCOUNT);\n var pmin = pts[i0].v;\n var i1 = Math.min(pts.length - 1, i + JITTERCOUNT);\n var pmax = pts[i1].v;\n\n if(mode !== 'all') {\n if(pts[i].v < d.lf) pmax = Math.min(pmax, d.lf);\n else pmin = Math.max(pmin, d.uf);\n }\n\n var jitterFactor = Math.sqrt(spreadLimit * (i1 - i0) / (pmax - pmin + minSpread)) || 0;\n jitterFactor = Lib.constrain(Math.abs(jitterFactor), 0, 1);\n\n jitterFactors.push(jitterFactor);\n maxJitterFactor = Math.max(jitterFactor, maxJitterFactor);\n }\n }\n newJitter = trace.jitter * 2 / (maxJitterFactor || 1);\n }\n\n // fills in 'x' and 'y' in calcdata 'pts' item\n for(i = 0; i < pts.length; i++) {\n var pt = pts[i];\n var v = pt.v;\n\n var jitterOffset = trace.jitter ?\n (newJitter * jitterFactors[i] * (Lib.pseudoRandom() - 0.5)) :\n 0;\n\n var posPx = d.pos + bPos + bdPos * (trace.pointpos + jitterOffset);\n\n if(trace.orientation === 'h') {\n pt.y = posPx;\n pt.x = v;\n } else {\n pt.x = posPx;\n pt.y = v;\n }\n\n // tag suspected outliers\n if(mode === 'suspectedoutliers' && v < d.uo && v > d.lo) {\n pt.so = true;\n }\n }\n\n return pts;\n });\n\n paths.enter().append('path')\n .classed('point', true);\n\n paths.exit().remove();\n\n paths.call(Drawing.translatePoints, xa, ya);\n}\n\nfunction plotBoxMean(sel, axes, trace, t) {\n var valAxis = axes.val;\n var posAxis = axes.pos;\n var posHasRangeBreaks = !!posAxis.rangebreaks;\n\n var bPos = t.bPos;\n var bPosPxOffset = t.bPosPxOffset || 0;\n\n // to support violin mean lines\n var mode = trace.boxmean || (trace.meanline || {}).visible;\n\n // to support for one-sided box\n var bdPos0;\n var bdPos1;\n if(Array.isArray(t.bdPos)) {\n bdPos0 = t.bdPos[0];\n bdPos1 = t.bdPos[1];\n } else {\n bdPos0 = t.bdPos;\n bdPos1 = t.bdPos;\n }\n\n var paths = sel.selectAll('path.mean').data((\n (trace.type === 'box' && trace.boxmean) ||\n (trace.type === 'violin' && trace.box.visible && trace.meanline.visible)\n ) ? Lib.identity : []);\n\n paths.enter().append('path')\n .attr('class', 'mean')\n .style({\n fill: 'none',\n 'vector-effect': 'non-scaling-stroke'\n });\n\n paths.exit().remove();\n\n paths.each(function(d) {\n var lcenter = posAxis.c2l(d.pos + bPos, true);\n\n var pos0 = posAxis.l2p(lcenter - bdPos0) + bPosPxOffset;\n var pos1 = posAxis.l2p(lcenter + bdPos1) + bPosPxOffset;\n var posc = posHasRangeBreaks ? (pos0 + pos1) / 2 : posAxis.l2p(lcenter) + bPosPxOffset;\n\n var m = valAxis.c2p(d.mean, true);\n var sl = valAxis.c2p(d.mean - d.sd, true);\n var sh = valAxis.c2p(d.mean + d.sd, true);\n\n if(trace.orientation === 'h') {\n d3.select(this).attr('d',\n 'M' + m + ',' + pos0 + 'V' + pos1 +\n (mode === 'sd' ?\n 'm0,0L' + sl + ',' + posc + 'L' + m + ',' + pos0 + 'L' + sh + ',' + posc + 'Z' :\n '')\n );\n } else {\n d3.select(this).attr('d',\n 'M' + pos0 + ',' + m + 'H' + pos1 +\n (mode === 'sd' ?\n 'm0,0L' + posc + ',' + sl + 'L' + pos0 + ',' + m + 'L' + posc + ',' + sh + 'Z' :\n '')\n );\n }\n });\n}\n\nmodule.exports = {\n plot: plot,\n plotBoxAndWhiskers: plotBoxAndWhiskers,\n plotPoints: plotPoints,\n plotBoxMean: plotBoxMean\n};\n","'use strict';\n\nmodule.exports = function eventData(out, pt, trace) {\n // standard cartesian event data\n out.x = 'xVal' in pt ? pt.xVal : pt.x;\n out.y = 'yVal' in pt ? pt.yVal : pt.y;\n if(pt.xa) out.xaxis = pt.xa;\n if(pt.ya) out.yaxis = pt.ya;\n\n if(trace.orientation === 'h') {\n out.label = out.y;\n out.value = out.x;\n } else {\n out.label = out.x;\n out.value = out.y;\n }\n\n return out;\n};\n","'use strict';\n\nvar Axes = require('../../plots/cartesian/axes');\nvar alignPeriod = require('../../plots/cartesian/align_period');\nvar hasColorscale = require('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleCalc = require('../../components/colorscale/calc');\nvar arraysToCalcdata = require('./arrays_to_calcdata');\nvar calcSelection = require('../scatter/calc_selection');\n\nmodule.exports = function calc(gd, trace) {\n var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n var size, pos, origPos, pObj, hasPeriod, pLetter;\n\n var sizeOpts = {\n msUTC: !!(trace.base || trace.base === 0)\n };\n\n if(trace.orientation === 'h') {\n size = xa.makeCalcdata(trace, 'x', sizeOpts);\n origPos = ya.makeCalcdata(trace, 'y');\n pObj = alignPeriod(trace, ya, 'y', origPos);\n hasPeriod = !!trace.yperiodalignment;\n pLetter = 'y';\n } else {\n size = ya.makeCalcdata(trace, 'y', sizeOpts);\n origPos = xa.makeCalcdata(trace, 'x');\n pObj = alignPeriod(trace, xa, 'x', origPos);\n hasPeriod = !!trace.xperiodalignment;\n pLetter = 'x';\n }\n pos = pObj.vals;\n\n // create the \"calculated data\" to plot\n var serieslen = Math.min(pos.length, size.length);\n var cd = new Array(serieslen);\n\n // set position and size\n for(var i = 0; i < serieslen; i++) {\n cd[i] = { p: pos[i], s: size[i] };\n\n if(hasPeriod) {\n cd[i].orig_p = origPos[i]; // used by hover\n cd[i][pLetter + 'End'] = pObj.ends[i];\n cd[i][pLetter + 'Start'] = pObj.starts[i];\n }\n\n if(trace.ids) {\n cd[i].id = String(trace.ids[i]);\n }\n }\n\n // auto-z and autocolorscale if applicable\n if(hasColorscale(trace, 'marker')) {\n colorscaleCalc(gd, trace, {\n vals: trace.marker.color,\n containerStr: 'marker',\n cLetter: 'c'\n });\n }\n if(hasColorscale(trace, 'marker.line')) {\n colorscaleCalc(gd, trace, {\n vals: trace.marker.line.color,\n containerStr: 'marker.line',\n cLetter: 'c'\n });\n }\n\n arraysToCalcdata(cd, trace);\n calcSelection(cd, trace);\n\n return cd;\n};\n","'use strict';\n\nmodule.exports = {\n hiddenlabels: {\n valType: 'data_array',\n editType: 'calc',\n description: [\n 'hiddenlabels is the funnelarea & pie chart analog of',\n 'visible:\\'legendonly\\'',\n 'but it can contain many labels, and can simultaneously',\n 'hide slices from several pies/funnelarea charts'\n ].join(' ')\n },\n piecolorway: {\n valType: 'colorlist',\n editType: 'calc',\n description: [\n 'Sets the default pie slice colors. Defaults to the main',\n '`colorway` used for trace colors. If you specify a new',\n 'list here it can still be extended with lighter and darker',\n 'colors, see `extendpiecolors`.'\n ].join(' ')\n },\n extendpiecolors: {\n valType: 'boolean',\n dflt: true,\n editType: 'calc',\n description: [\n 'If `true`, the pie slice colors (whether given by `piecolorway` or',\n 'inherited from `colorway`) will be extended to three times its',\n 'original length by first repeating every color 20% lighter then',\n 'each color 20% darker. This is intended to reduce the likelihood',\n 'of reusing the same color when you have many slices, but you can',\n 'set `false` to disable.',\n 'Colors provided in the trace, using `marker.colors`, are never',\n 'extended.'\n ].join(' ')\n }\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Axes = require('../../plots/cartesian/axes');\nvar alignPeriod = require('../../plots/cartesian/align_period');\nvar Lib = require('../../lib');\n\nvar BADNUM = require('../../constants/numerical').BADNUM;\nvar _ = Lib._;\n\nmodule.exports = function calc(gd, trace) {\n var fullLayout = gd._fullLayout;\n var xa = Axes.getFromId(gd, trace.xaxis || 'x');\n var ya = Axes.getFromId(gd, trace.yaxis || 'y');\n var cd = [];\n\n // N.B. violin reuses same Box.calc\n var numKey = trace.type === 'violin' ? '_numViolins' : '_numBoxes';\n\n var i, j;\n var valAxis, valLetter;\n var posAxis, posLetter;\n\n var hasPeriod;\n if(trace.orientation === 'h') {\n valAxis = xa;\n valLetter = 'x';\n posAxis = ya;\n posLetter = 'y';\n hasPeriod = !!trace.yperiodalignment;\n } else {\n valAxis = ya;\n valLetter = 'y';\n posAxis = xa;\n posLetter = 'x';\n hasPeriod = !!trace.xperiodalignment;\n }\n\n var allPosArrays = getPosArrays(trace, posLetter, posAxis, fullLayout[numKey]);\n var posArray = allPosArrays[0];\n var origPos = allPosArrays[1];\n var dv = Lib.distinctVals(posArray, posAxis);\n var posDistinct = dv.vals;\n var dPos = dv.minDiff / 2;\n\n // item in trace calcdata\n var cdi;\n // array of {v: v, i, i} sample pts\n var pts;\n // values of the `pts` array of objects\n var boxVals;\n // length of sample\n var N;\n // single sample point\n var pt;\n // single sample value\n var v;\n\n // filter function for outlier pts\n // outlier definition based on http://www.physics.csbsju.edu/stats/box2.html\n var ptFilterFn = (trace.boxpoints || trace.points) === 'all' ?\n Lib.identity :\n function(pt) { return (pt.v < cdi.lf || pt.v > cdi.uf); };\n\n if(trace._hasPreCompStats) {\n var valArrayRaw = trace[valLetter];\n var d2c = function(k) { return valAxis.d2c((trace[k] || [])[i]); };\n var minVal = Infinity;\n var maxVal = -Infinity;\n\n for(i = 0; i < trace._length; i++) {\n var posi = posArray[i];\n if(!isNumeric(posi)) continue;\n\n cdi = {};\n cdi.pos = cdi[posLetter] = posi;\n if(hasPeriod && origPos) {\n cdi.orig_p = origPos[i]; // used by hover\n }\n\n cdi.q1 = d2c('q1');\n cdi.med = d2c('median');\n cdi.q3 = d2c('q3');\n\n pts = [];\n if(valArrayRaw && Lib.isArrayOrTypedArray(valArrayRaw[i])) {\n for(j = 0; j < valArrayRaw[i].length; j++) {\n v = valAxis.d2c(valArrayRaw[i][j]);\n if(v !== BADNUM) {\n pt = {v: v, i: [i, j]};\n arraysToCalcdata(pt, trace, [i, j]);\n pts.push(pt);\n }\n }\n }\n cdi.pts = pts.sort(sortByVal);\n boxVals = cdi[valLetter] = pts.map(extractVal);\n N = boxVals.length;\n\n if(cdi.med !== BADNUM && cdi.q1 !== BADNUM && cdi.q3 !== BADNUM &&\n cdi.med >= cdi.q1 && cdi.q3 >= cdi.med\n ) {\n var lf = d2c('lowerfence');\n cdi.lf = (lf !== BADNUM && lf <= cdi.q1) ?\n lf :\n computeLowerFence(cdi, boxVals, N);\n\n var uf = d2c('upperfence');\n cdi.uf = (uf !== BADNUM && uf >= cdi.q3) ?\n uf :\n computeUpperFence(cdi, boxVals, N);\n\n var mean = d2c('mean');\n cdi.mean = (mean !== BADNUM) ?\n mean :\n (N ? Lib.mean(boxVals, N) : (cdi.q1 + cdi.q3) / 2);\n\n var sd = d2c('sd');\n cdi.sd = (mean !== BADNUM && sd >= 0) ?\n sd :\n (N ? Lib.stdev(boxVals, N, cdi.mean) : (cdi.q3 - cdi.q1));\n\n cdi.lo = computeLowerOutlierBound(cdi);\n cdi.uo = computeUpperOutlierBound(cdi);\n\n var ns = d2c('notchspan');\n ns = (ns !== BADNUM && ns > 0) ? ns : computeNotchSpan(cdi, N);\n cdi.ln = cdi.med - ns;\n cdi.un = cdi.med + ns;\n\n var imin = cdi.lf;\n var imax = cdi.uf;\n if(trace.boxpoints && boxVals.length) {\n imin = Math.min(imin, boxVals[0]);\n imax = Math.max(imax, boxVals[N - 1]);\n }\n if(trace.notched) {\n imin = Math.min(imin, cdi.ln);\n imax = Math.max(imax, cdi.un);\n }\n cdi.min = imin;\n cdi.max = imax;\n } else {\n Lib.warn([\n 'Invalid input - make sure that q1 <= median <= q3',\n 'q1 = ' + cdi.q1,\n 'median = ' + cdi.med,\n 'q3 = ' + cdi.q3\n ].join('\\n'));\n\n var v0;\n if(cdi.med !== BADNUM) {\n v0 = cdi.med;\n } else if(cdi.q1 !== BADNUM) {\n if(cdi.q3 !== BADNUM) v0 = (cdi.q1 + cdi.q3) / 2;\n else v0 = cdi.q1;\n } else if(cdi.q3 !== BADNUM) {\n v0 = cdi.q3;\n } else {\n v0 = 0;\n }\n\n // draw box as line segment\n cdi.med = v0;\n cdi.q1 = cdi.q3 = v0;\n cdi.lf = cdi.uf = v0;\n cdi.mean = cdi.sd = v0;\n cdi.ln = cdi.un = v0;\n cdi.min = cdi.max = v0;\n }\n\n minVal = Math.min(minVal, cdi.min);\n maxVal = Math.max(maxVal, cdi.max);\n\n cdi.pts2 = pts.filter(ptFilterFn);\n\n cd.push(cdi);\n }\n\n trace._extremes[valAxis._id] = Axes.findExtremes(valAxis,\n [minVal, maxVal],\n {padded: true}\n );\n } else {\n var valArray = valAxis.makeCalcdata(trace, valLetter);\n var posBins = makeBins(posDistinct, dPos);\n var pLen = posDistinct.length;\n var ptsPerBin = initNestedArray(pLen);\n\n // bin pts info per position bins\n for(i = 0; i < trace._length; i++) {\n v = valArray[i];\n if(!isNumeric(v)) continue;\n\n var n = Lib.findBin(posArray[i], posBins);\n if(n >= 0 && n < pLen) {\n pt = {v: v, i: i};\n arraysToCalcdata(pt, trace, i);\n ptsPerBin[n].push(pt);\n }\n }\n\n var minLowerNotch = Infinity;\n var maxUpperNotch = -Infinity;\n\n var quartilemethod = trace.quartilemethod;\n var usesExclusive = quartilemethod === 'exclusive';\n var usesInclusive = quartilemethod === 'inclusive';\n\n // build calcdata trace items, one item per distinct position\n for(i = 0; i < pLen; i++) {\n if(ptsPerBin[i].length > 0) {\n cdi = {};\n cdi.pos = cdi[posLetter] = posDistinct[i];\n\n pts = cdi.pts = ptsPerBin[i].sort(sortByVal);\n boxVals = cdi[valLetter] = pts.map(extractVal);\n N = boxVals.length;\n\n cdi.min = boxVals[0];\n cdi.max = boxVals[N - 1];\n cdi.mean = Lib.mean(boxVals, N);\n cdi.sd = Lib.stdev(boxVals, N, cdi.mean) * trace.sdmultiple;\n cdi.med = Lib.interp(boxVals, 0.5);\n\n if((N % 2) && (usesExclusive || usesInclusive)) {\n var lower;\n var upper;\n\n if(usesExclusive) {\n // do NOT include the median in either half\n lower = boxVals.slice(0, N / 2);\n upper = boxVals.slice(N / 2 + 1);\n } else if(usesInclusive) {\n // include the median in either half\n lower = boxVals.slice(0, N / 2 + 1);\n upper = boxVals.slice(N / 2);\n }\n\n cdi.q1 = Lib.interp(lower, 0.5);\n cdi.q3 = Lib.interp(upper, 0.5);\n } else {\n cdi.q1 = Lib.interp(boxVals, 0.25);\n cdi.q3 = Lib.interp(boxVals, 0.75);\n }\n\n // lower and upper fences\n cdi.lf = computeLowerFence(cdi, boxVals, N);\n cdi.uf = computeUpperFence(cdi, boxVals, N);\n\n // lower and upper outliers bounds\n cdi.lo = computeLowerOutlierBound(cdi);\n cdi.uo = computeUpperOutlierBound(cdi);\n\n // lower and upper notches\n var mci = computeNotchSpan(cdi, N);\n cdi.ln = cdi.med - mci;\n cdi.un = cdi.med + mci;\n minLowerNotch = Math.min(minLowerNotch, cdi.ln);\n maxUpperNotch = Math.max(maxUpperNotch, cdi.un);\n\n cdi.pts2 = pts.filter(ptFilterFn);\n\n cd.push(cdi);\n }\n }\n\n if(trace.notched && Lib.isTypedArray(valArray)) valArray = Array.from(valArray);\n trace._extremes[valAxis._id] = Axes.findExtremes(valAxis,\n trace.notched ? valArray.concat([minLowerNotch, maxUpperNotch]) : valArray,\n {padded: true}\n );\n }\n\n calcSelection(cd, trace);\n\n if(cd.length > 0) {\n cd[0].t = {\n num: fullLayout[numKey],\n dPos: dPos,\n posLetter: posLetter,\n valLetter: valLetter,\n labels: {\n med: _(gd, 'median:'),\n min: _(gd, 'min:'),\n q1: _(gd, 'q1:'),\n q3: _(gd, 'q3:'),\n max: _(gd, 'max:'),\n mean: (trace.boxmean === 'sd') || (trace.sizemode === 'sd') ?\n _(gd, 'mean ± σ:').replace('σ', trace.sdmultiple === 1 ? 'σ' : (trace.sdmultiple + 'σ')) : // displaying mean +- Nσ whilst supporting translations\n _(gd, 'mean:'),\n lf: _(gd, 'lower fence:'),\n uf: _(gd, 'upper fence:')\n }\n };\n\n fullLayout[numKey]++;\n return cd;\n } else {\n return [{t: {empty: true}}];\n }\n};\n\n// In vertical (horizontal) box plots:\n// if no x (y) data, use x0 (y0), or name\n// so if you want one box\n// per trace, set x0 (y0) to the x (y) value or category for this trace\n// (or set x (y) to a constant array matching y (x))\nfunction getPosArrays(trace, posLetter, posAxis, num) {\n var hasPosArray = posLetter in trace;\n var hasPos0 = posLetter + '0' in trace;\n var hasPosStep = 'd' + posLetter in trace;\n\n if(hasPosArray || (hasPos0 && hasPosStep)) {\n var origPos = posAxis.makeCalcdata(trace, posLetter);\n var pos = alignPeriod(trace, posAxis, posLetter, origPos).vals;\n return [pos, origPos];\n }\n\n var pos0;\n if(hasPos0) {\n pos0 = trace[posLetter + '0'];\n } else if('name' in trace && (\n posAxis.type === 'category' || (\n isNumeric(trace.name) &&\n ['linear', 'log'].indexOf(posAxis.type) !== -1\n ) || (\n Lib.isDateTime(trace.name) &&\n posAxis.type === 'date'\n )\n )) {\n pos0 = trace.name;\n } else {\n pos0 = num;\n }\n\n var pos0c = posAxis.type === 'multicategory' ?\n posAxis.r2c_just_indices(pos0) :\n posAxis.d2c(pos0, 0, trace[posLetter + 'calendar']);\n\n var len = trace._length;\n var out = new Array(len);\n for(var i = 0; i < len; i++) out[i] = pos0c;\n\n return [out];\n}\n\nfunction makeBins(x, dx) {\n var len = x.length;\n var bins = new Array(len + 1);\n\n for(var i = 0; i < len; i++) {\n bins[i] = x[i] - dx;\n }\n bins[len] = x[len - 1] + dx;\n\n return bins;\n}\n\nfunction initNestedArray(len) {\n var arr = new Array(len);\n for(var i = 0; i < len; i++) {\n arr[i] = [];\n }\n return arr;\n}\n\nvar TRACE_TO_CALC = {\n text: 'tx',\n hovertext: 'htx'\n};\n\nfunction arraysToCalcdata(pt, trace, ptNumber) {\n for(var k in TRACE_TO_CALC) {\n if(Lib.isArrayOrTypedArray(trace[k])) {\n if(Array.isArray(ptNumber)) {\n if(Lib.isArrayOrTypedArray(trace[k][ptNumber[0]])) {\n pt[TRACE_TO_CALC[k]] = trace[k][ptNumber[0]][ptNumber[1]];\n }\n } else {\n pt[TRACE_TO_CALC[k]] = trace[k][ptNumber];\n }\n }\n }\n}\n\nfunction calcSelection(cd, trace) {\n if(Lib.isArrayOrTypedArray(trace.selectedpoints)) {\n for(var i = 0; i < cd.length; i++) {\n var pts = cd[i].pts || [];\n var ptNumber2cdIndex = {};\n\n for(var j = 0; j < pts.length; j++) {\n ptNumber2cdIndex[pts[j].i] = j;\n }\n\n Lib.tagSelected(pts, trace, ptNumber2cdIndex);\n }\n }\n}\n\nfunction sortByVal(a, b) { return a.v - b.v; }\n\nfunction extractVal(o) { return o.v; }\n\n// last point below 1.5 * IQR\nfunction computeLowerFence(cdi, boxVals, N) {\n if(N === 0) return cdi.q1;\n return Math.min(\n cdi.q1,\n boxVals[Math.min(\n Lib.findBin(2.5 * cdi.q1 - 1.5 * cdi.q3, boxVals, true) + 1,\n N - 1\n )]\n );\n}\n\n// last point above 1.5 * IQR\nfunction computeUpperFence(cdi, boxVals, N) {\n if(N === 0) return cdi.q3;\n return Math.max(\n cdi.q3,\n boxVals[Math.max(\n Lib.findBin(2.5 * cdi.q3 - 1.5 * cdi.q1, boxVals),\n 0\n )]\n );\n}\n\n// 3 IQR below (don't clip to max/min,\n// this is only for discriminating suspected & far outliers)\nfunction computeLowerOutlierBound(cdi) {\n return 4 * cdi.q1 - 3 * cdi.q3;\n}\n\n// 3 IQR above (don't clip to max/min,\n// this is only for discriminating suspected & far outliers)\nfunction computeUpperOutlierBound(cdi) {\n return 4 * cdi.q3 - 3 * cdi.q1;\n}\n\n// 95% confidence intervals for median\nfunction computeNotchSpan(cdi, N) {\n if(N === 0) return 0;\n return 1.57 * (cdi.q3 - cdi.q1) / Math.sqrt(N);\n}\n","'use strict';\n\n\nmodule.exports = {\n percent: function(size, total) {\n var nMax = size.length;\n var norm = 100 / total;\n for(var n = 0; n < nMax; n++) size[n] *= norm;\n },\n probability: function(size, total) {\n var nMax = size.length;\n for(var n = 0; n < nMax; n++) size[n] /= total;\n },\n density: function(size, total, inc, yinc) {\n var nMax = size.length;\n yinc = yinc || 1;\n for(var n = 0; n < nMax; n++) size[n] *= inc[n] * yinc;\n },\n 'probability density': function(size, total, inc, yinc) {\n var nMax = size.length;\n if(yinc) total /= yinc;\n for(var n = 0; n < nMax; n++) size[n] *= inc[n] / total;\n }\n};\n","'use strict';\n\nvar d3 = require('@plotly/d3');\n\nvar styleOne = require('./style_one');\nvar resizeText = require('../bar/uniform_text').resizeText;\n\nmodule.exports = function style(gd) {\n var s = gd._fullLayout._pielayer.selectAll('.trace');\n resizeText(gd, s, 'pie');\n\n s.each(function(cd) {\n var cd0 = cd[0];\n var trace = cd0.trace;\n var traceSelection = d3.select(this);\n\n traceSelection.style({opacity: trace.opacity});\n\n traceSelection.selectAll('path.surface').each(function(pt) {\n d3.select(this).call(styleOne, pt, trace, gd);\n });\n });\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\nvar Lib = require('../../lib');\nvar attributes = require('./attributes');\nvar handleDomainDefaults = require('../../plots/domain').defaults;\nvar handleText = require('../bar/defaults').handleText;\nvar coercePattern = require('../../lib').coercePattern;\n\nfunction handleLabelsAndValues(labels, values) {\n var hasLabels = Lib.isArrayOrTypedArray(labels);\n var hasValues = Lib.isArrayOrTypedArray(values);\n var len = Math.min(\n hasLabels ? labels.length : Infinity,\n hasValues ? values.length : Infinity\n );\n\n if(!isFinite(len)) len = 0;\n\n if(len && hasValues) {\n var hasPositive;\n for(var i = 0; i < len; i++) {\n var v = values[i];\n if(isNumeric(v) && v > 0) {\n hasPositive = true;\n break;\n }\n }\n if(!hasPositive) len = 0;\n }\n\n return {\n hasLabels: hasLabels,\n hasValues: hasValues,\n len: len\n };\n}\n\nfunction handleMarkerDefaults(traceIn, traceOut, layout, coerce, isPie) {\n var lineWidth = coerce('marker.line.width');\n if(lineWidth) {\n coerce('marker.line.color',\n isPie ? undefined :\n layout.paper_bgcolor // case of funnelarea, sunburst, icicle, treemap\n );\n }\n\n var markerColors = coerce('marker.colors');\n coercePattern(coerce, 'marker.pattern', markerColors);\n // push the marker colors (with s) to the foreground colors, to work around logic in the drawing pattern code on marker.color (without s, which is okay for a bar trace)\n if(traceIn.marker && !traceOut.marker.pattern.fgcolor) traceOut.marker.pattern.fgcolor = traceIn.marker.colors;\n if(!traceOut.marker.pattern.bgcolor) traceOut.marker.pattern.bgcolor = layout.paper_bgcolor;\n}\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var labels = coerce('labels');\n var values = coerce('values');\n\n var res = handleLabelsAndValues(labels, values);\n var len = res.len;\n traceOut._hasLabels = res.hasLabels;\n traceOut._hasValues = res.hasValues;\n\n if(!traceOut._hasLabels &&\n traceOut._hasValues\n ) {\n coerce('label0');\n coerce('dlabel');\n }\n\n if(!len) {\n traceOut.visible = false;\n return;\n }\n traceOut._length = len;\n\n handleMarkerDefaults(traceIn, traceOut, layout, coerce, true);\n\n coerce('scalegroup');\n // TODO: hole needs to be coerced to the same value within a scaleegroup\n\n var textData = coerce('text');\n var textTemplate = coerce('texttemplate');\n var textInfo;\n if(!textTemplate) textInfo = coerce('textinfo', Lib.isArrayOrTypedArray(textData) ? 'text+percent' : 'percent');\n\n coerce('hovertext');\n coerce('hovertemplate');\n\n if(textTemplate || (textInfo && textInfo !== 'none')) {\n var textposition = coerce('textposition');\n handleText(traceIn, traceOut, layout, coerce, textposition, {\n moduleHasSelected: false,\n moduleHasUnselected: false,\n moduleHasConstrain: false,\n moduleHasCliponaxis: false,\n moduleHasTextangle: false,\n moduleHasInsideanchor: false\n });\n\n var hasBoth = Array.isArray(textposition) || textposition === 'auto';\n var hasOutside = hasBoth || textposition === 'outside';\n if(hasOutside) {\n coerce('automargin');\n }\n\n if(textposition === 'inside' || textposition === 'auto' || Array.isArray(textposition)) {\n coerce('insidetextorientation');\n }\n }\n\n handleDomainDefaults(traceOut, layout, coerce);\n\n var hole = coerce('hole');\n var title = coerce('title.text');\n if(title) {\n var titlePosition = coerce('title.position', hole ? 'middle center' : 'top center');\n if(!hole && titlePosition === 'middle center') traceOut.title.position = 'top center';\n Lib.coerceFont(coerce, 'title.font', layout.font);\n }\n\n coerce('sort');\n coerce('direction');\n coerce('rotation');\n coerce('pull');\n}\n\nmodule.exports = {\n handleLabelsAndValues: handleLabelsAndValues,\n handleMarkerDefaults: handleMarkerDefaults,\n supplyDefaults: supplyDefaults\n};\n","'use strict';\n\nvar subtypes = require('./subtypes');\n\nmodule.exports = {\n hasLines: subtypes.hasLines,\n hasMarkers: subtypes.hasMarkers,\n hasText: subtypes.hasText,\n isBubble: subtypes.isBubble,\n\n attributes: require('./attributes'),\n layoutAttributes: require('./layout_attributes'),\n supplyDefaults: require('./defaults'),\n crossTraceDefaults: require('./cross_trace_defaults'),\n supplyLayoutDefaults: require('./layout_defaults'),\n calc: require('./calc').calc,\n crossTraceCalc: require('./cross_trace_calc'),\n arraysToCalcdata: require('./arrays_to_calcdata'),\n plot: require('./plot'),\n colorbar: require('./marker_colorbar'),\n formatLabels: require('./format_labels'),\n style: require('./style').style,\n styleOnSelect: require('./style').styleOnSelect,\n hoverPoints: require('./hover'),\n selectPoints: require('./select'),\n animatable: true,\n\n moduleType: 'trace',\n name: 'scatter',\n basePlotModule: require('../../plots/cartesian'),\n categories: [\n 'cartesian', 'svg', 'symbols', 'errorBarsOK', 'showLegend', 'scatter-like',\n 'zoomScale'\n ],\n meta: {\n description: [\n 'The scatter trace type encompasses line charts, scatter charts, text charts, and bubble charts.',\n 'The data visualized as scatter point or lines is set in `x` and `y`.',\n 'Text (appearing either on the chart or on hover only) is via `text`.',\n 'Bubble charts are achieved by setting `marker.size` and/or `marker.color`',\n 'to numerical arrays.'\n ].join(' ')\n }\n};\n","'use strict';\n\nvar Lib = require('../lib');\nvar EventEmitter = require('events').EventEmitter;\n\nvar helpers = require('./helpers');\n\nfunction svgToImg(opts) {\n var ev = opts.emitter || new EventEmitter();\n\n var promise = new Promise(function(resolve, reject) {\n var Image = window.Image;\n var svg = opts.svg;\n var format = opts.format || 'png';\n\n // IE only support svg\n if(Lib.isIE() && format !== 'svg') {\n var ieSvgError = new Error(helpers.MSG_IE_BAD_FORMAT);\n reject(ieSvgError);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', ieSvgError);\n } else {\n return promise;\n }\n }\n\n var canvas = opts.canvas;\n var scale = opts.scale || 1;\n var w0 = opts.width || 300;\n var h0 = opts.height || 150;\n var w1 = scale * w0;\n var h1 = scale * h0;\n\n var ctx = canvas.getContext('2d', {willReadFrequently: true});\n var img = new Image();\n var svgBlob, url;\n\n if(format === 'svg' || Lib.isSafari()) {\n url = helpers.encodeSVG(svg);\n } else {\n svgBlob = helpers.createBlob(svg, 'svg');\n url = helpers.createObjectURL(svgBlob);\n }\n\n canvas.width = w1;\n canvas.height = h1;\n\n img.onload = function() {\n var imgData;\n\n svgBlob = null;\n helpers.revokeObjectURL(url);\n\n // don't need to draw to canvas if svg\n // save some time and also avoid failure on IE\n if(format !== 'svg') {\n ctx.drawImage(img, 0, 0, w1, h1);\n }\n\n switch(format) {\n case 'jpeg':\n imgData = canvas.toDataURL('image/jpeg');\n break;\n case 'png':\n imgData = canvas.toDataURL('image/png');\n break;\n case 'webp':\n imgData = canvas.toDataURL('image/webp');\n break;\n case 'svg':\n imgData = url;\n break;\n default:\n var errorMsg = 'Image format is not jpeg, png, svg or webp.';\n reject(new Error(errorMsg));\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', errorMsg);\n }\n }\n resolve(imgData);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n ev.emit('success', imgData);\n }\n };\n\n img.onerror = function(err) {\n svgBlob = null;\n helpers.revokeObjectURL(url);\n\n reject(err);\n // eventually remove the ev\n // in favor of promises\n if(!opts.promise) {\n return ev.emit('error', err);\n }\n };\n\n img.src = url;\n });\n\n // temporary for backward compatibility\n // move to only Promise in 2.0.0\n // and eliminate the EventEmitter\n if(opts.promise) {\n return promise;\n }\n\n return ev;\n}\n\nmodule.exports = svgToImg;\n","'use strict';\n\nvar Lib = require('../../lib');\nvar handleGroupingDefaults = require('./grouping_defaults');\nvar attributes = require('./attributes');\n\n// remove opacity for any trace that has a fill or is filled to\nmodule.exports = function crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut, i;\n\n function coerce(attr) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr);\n }\n\n if(fullLayout.scattermode === 'group') {\n for(i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n\n if(traceOut.type === 'scatter') {\n traceIn = traceOut._input;\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n }\n\n for(i = 0; i < fullData.length; i++) {\n var tracei = fullData[i];\n if(tracei.type !== 'scatter') continue;\n\n var filli = tracei.fill;\n if(filli === 'none' || filli === 'toself') continue;\n\n tracei.opacity = undefined;\n\n if(filli === 'tonexty' || filli === 'tonextx') {\n for(var j = i - 1; j >= 0; j--) {\n var tracej = fullData[j];\n\n if((tracej.type === 'scatter') &&\n (tracej.xaxis === tracei.xaxis) &&\n (tracej.yaxis === tracei.yaxis)) {\n tracej.opacity = undefined;\n break;\n }\n }\n }\n }\n};\n","'use strict';\n\nmodule.exports = Sieve;\n\nvar distinctVals = require('../../lib').distinctVals;\n\n/**\n * Helper class to sieve data from traces into bins\n *\n * @class\n *\n * @param {Array} traces\n* Array of calculated traces\n * @param {object} opts\n * - @param {boolean} [sepNegVal]\n * If true, then split data at the same position into a bar\n * for positive values and another for negative values\n * - @param {boolean} [overlapNoMerge]\n * If true, then don't merge overlapping bars into a single bar\n */\nfunction Sieve(traces, opts) {\n this.traces = traces;\n this.sepNegVal = opts.sepNegVal;\n this.overlapNoMerge = opts.overlapNoMerge;\n\n // for single-bin histograms - see histogram/calc\n var width1 = Infinity;\n\n var axLetter = opts.posAxis._id.charAt(0);\n\n var positions = [];\n for(var i = 0; i < traces.length; i++) {\n var trace = traces[i];\n for(var j = 0; j < trace.length; j++) {\n var bar = trace[j];\n var pos = bar.p;\n if(pos === undefined) {\n pos = bar[axLetter];\n }\n if(pos !== undefined) positions.push(pos);\n }\n if(trace[0] && trace[0].width1) {\n width1 = Math.min(trace[0].width1, width1);\n }\n }\n this.positions = positions;\n\n var dv = distinctVals(positions);\n\n this.distinctPositions = dv.vals;\n if(dv.vals.length === 1 && width1 !== Infinity) this.minDiff = width1;\n else this.minDiff = Math.min(dv.minDiff, width1);\n\n var type = (opts.posAxis || {}).type;\n if(type === 'category' || type === 'multicategory') {\n this.minDiff = 1;\n }\n\n this.binWidth = this.minDiff;\n\n this.bins = {};\n}\n\n/**\n * Sieve datum\n *\n * @method\n * @param {number} position\n * @param {number} value\n * @returns {number} Previous bin value\n */\nSieve.prototype.put = function put(position, value) {\n var label = this.getLabel(position, value);\n var oldValue = this.bins[label] || 0;\n\n this.bins[label] = oldValue + value;\n\n return oldValue;\n};\n\n/**\n * Get current bin value for a given datum\n *\n * @method\n * @param {number} position Position of datum\n * @param {number} [value] Value of datum\n * (required if this.sepNegVal is true)\n * @returns {number} Current bin value\n */\nSieve.prototype.get = function get(position, value) {\n var label = this.getLabel(position, value);\n return this.bins[label] || 0;\n};\n\n/**\n * Get bin label for a given datum\n *\n * @method\n * @param {number} position Position of datum\n * @param {number} [value] Value of datum\n * (required if this.sepNegVal is true)\n * @returns {string} Bin label\n * (prefixed with a 'v' if value is negative and this.sepNegVal is\n * true; otherwise prefixed with '^')\n */\nSieve.prototype.getLabel = function getLabel(position, value) {\n var prefix = (value < 0 && this.sepNegVal) ? 'v' : '^';\n var label = (this.overlapNoMerge) ?\n position :\n Math.round(position / this.binWidth);\n return prefix + label;\n};\n","'use strict';\n\nvar Lib = require('../../lib');\n\nvar INTERPTHRESHOLD = 1e-2;\nvar NEIGHBORSHIFTS = [[-1, 0], [1, 0], [0, -1], [0, 1]];\n\nfunction correctionOvershoot(maxFractionalChange) {\n // start with less overshoot, until we know it's converging,\n // then ramp up the overshoot for faster convergence\n return 0.5 - 0.25 * Math.min(1, maxFractionalChange * 0.5);\n}\n\n/*\n * interp2d: Fill in missing data from a 2D array using an iterative\n * poisson equation solver with zero-derivative BC at edges.\n * Amazingly, this just amounts to repeatedly averaging all the existing\n * nearest neighbors, at least if we don't take x/y scaling into account,\n * which is the right approach here where x and y may not even have the\n * same units.\n *\n * @param {array of arrays} z\n * The 2D array to fill in. Will be mutated here. Assumed to already be\n * cleaned, so all entries are numbers except gaps, which are `undefined`.\n * @param {array of arrays} emptyPoints\n * Each entry [i, j, neighborCount] for empty points z[i][j] and the number\n * of neighbors that are *not* missing. Assumed to be sorted from most to\n * least neighbors, as produced by heatmap/find_empties.\n */\nmodule.exports = function interp2d(z, emptyPoints) {\n var maxFractionalChange = 1;\n var i;\n\n // one pass to fill in a starting value for all the empties\n iterateInterp2d(z, emptyPoints);\n\n // we're don't need to iterate lone empties - remove them\n for(i = 0; i < emptyPoints.length; i++) {\n if(emptyPoints[i][2] < 4) break;\n }\n // but don't remove these points from the original array,\n // we'll use them for masking, so make a copy.\n emptyPoints = emptyPoints.slice(i);\n\n for(i = 0; i < 100 && maxFractionalChange > INTERPTHRESHOLD; i++) {\n maxFractionalChange = iterateInterp2d(z, emptyPoints,\n correctionOvershoot(maxFractionalChange));\n }\n if(maxFractionalChange > INTERPTHRESHOLD) {\n Lib.log('interp2d didn\\'t converge quickly', maxFractionalChange);\n }\n\n return z;\n};\n\nfunction iterateInterp2d(z, emptyPoints, overshoot) {\n var maxFractionalChange = 0;\n var thisPt;\n var i;\n var j;\n var p;\n var q;\n var neighborShift;\n var neighborRow;\n var neighborVal;\n var neighborCount;\n var neighborSum;\n var initialVal;\n var minNeighbor;\n var maxNeighbor;\n\n for(p = 0; p < emptyPoints.length; p++) {\n thisPt = emptyPoints[p];\n i = thisPt[0];\n j = thisPt[1];\n initialVal = z[i][j];\n neighborSum = 0;\n neighborCount = 0;\n\n for(q = 0; q < 4; q++) {\n neighborShift = NEIGHBORSHIFTS[q];\n neighborRow = z[i + neighborShift[0]];\n if(!neighborRow) continue;\n neighborVal = neighborRow[j + neighborShift[1]];\n if(neighborVal !== undefined) {\n if(neighborSum === 0) {\n minNeighbor = maxNeighbor = neighborVal;\n } else {\n minNeighbor = Math.min(minNeighbor, neighborVal);\n maxNeighbor = Math.max(maxNeighbor, neighborVal);\n }\n neighborCount++;\n neighborSum += neighborVal;\n }\n }\n\n if(neighborCount === 0) {\n throw 'iterateInterp2d order is wrong: no defined neighbors';\n }\n\n // this is the laplace equation interpolation:\n // each point is just the average of its neighbors\n // note that this ignores differential x/y scaling\n // which I think is the right approach, since we\n // don't know what that scaling means\n z[i][j] = neighborSum / neighborCount;\n\n if(initialVal === undefined) {\n if(neighborCount < 4) maxFractionalChange = 1;\n } else {\n // we can make large empty regions converge faster\n // if we overshoot the change vs the previous value\n z[i][j] = (1 + overshoot) * z[i][j] - overshoot * initialVal;\n\n if(maxNeighbor > minNeighbor) {\n maxFractionalChange = Math.max(maxFractionalChange,\n Math.abs(z[i][j] - initialVal) / (maxNeighbor - minNeighbor));\n }\n }\n }\n\n return maxFractionalChange;\n}\n","'use strict';\n\nvar appendArrayMultiPointValues = require('../../components/fx/helpers').appendArrayMultiPointValues;\n\n// Note: like other eventData routines, this creates the data for hover/unhover/click events\n// but it has a different API and goes through a totally different pathway.\n// So to ensure it doesn't get misused, it's not attached to the Pie module.\nmodule.exports = function eventData(pt, trace) {\n var out = {\n curveNumber: trace.index,\n pointNumbers: pt.pts,\n data: trace._input,\n fullData: trace,\n label: pt.label,\n color: pt.color,\n value: pt.v,\n percent: pt.percent,\n text: pt.text,\n bbox: pt.bbox,\n\n // pt.v (and pt.i below) for backward compatibility\n v: pt.v\n };\n\n // Only include pointNumber if it's unambiguous\n if(pt.pts.length === 1) out.pointNumber = out.i = pt.pts[0];\n\n // Add extra data arrays to the output\n // notice that this is the multi-point version ('s' on the end!)\n // so added data will be arrays matching the pointNumbers array.\n appendArrayMultiPointValues(out, trace, pt.pts);\n\n // don't include obsolete fields in new funnelarea traces\n if(trace.type === 'funnelarea') {\n delete out.v;\n delete out.i;\n }\n\n return out;\n};\n","'use strict';\n\nvar Lib = require('../../lib');\n\nvar handleXYZDefaults = require('./xyz_defaults');\nvar handleHeatmapLabelDefaults = require('./label_defaults');\nvar handlePeriodDefaults = require('../scatter/period_defaults');\nvar handleStyleDefaults = require('./style_defaults');\nvar colorscaleDefaults = require('../../components/colorscale/defaults');\nvar attributes = require('./attributes');\n\n\nmodule.exports = function supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var validData = handleXYZDefaults(traceIn, traceOut, coerce, layout);\n if(!validData) {\n traceOut.visible = false;\n return;\n }\n\n handlePeriodDefaults(traceIn, traceOut, layout, coerce);\n coerce('xhoverformat');\n coerce('yhoverformat');\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n handleHeatmapLabelDefaults(coerce, layout);\n handleStyleDefaults(traceIn, traceOut, coerce, layout);\n\n coerce('hoverongaps');\n coerce('connectgaps', Lib.isArray1D(traceOut.z) && (traceOut.zsmooth !== false));\n\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: '', cLetter: 'z'});\n};\n","'use strict';\n\nvar Lib = require('../../lib');\n\n/*\n * opts: object of flags to control features not all text users support\n * noSelect: caller does not support selected/unselected attribute containers\n */\nmodule.exports = function(traceIn, traceOut, layout, coerce, opts) {\n opts = opts || {};\n\n coerce('textposition');\n Lib.coerceFont(coerce, 'textfont', opts.font || layout.font);\n\n if(!opts.noSelect) {\n coerce('selected.textfont.color');\n coerce('unselected.textfont.color');\n }\n};\n","'use strict';\n\nvar Fx = require('../../components/fx');\nvar Registry = require('../../registry');\nvar Color = require('../../components/color');\n\nvar fillText = require('../../lib').fillText;\nvar getLineWidth = require('./helpers').getLineWidth;\nvar hoverLabelText = require('../../plots/cartesian/axes').hoverLabelText;\nvar BADNUM = require('../../constants/numerical').BADNUM;\n\nfunction hoverPoints(pointData, xval, yval, hovermode, opts) {\n var barPointData = hoverOnBars(pointData, xval, yval, hovermode, opts);\n\n if(barPointData) {\n var cd = barPointData.cd;\n var trace = cd[0].trace;\n var di = cd[barPointData.index];\n\n barPointData.color = getTraceColor(trace, di);\n Registry.getComponentMethod('errorbars', 'hoverInfo')(di, trace, barPointData);\n\n return [barPointData];\n }\n}\n\nfunction hoverOnBars(pointData, xval, yval, hovermode, opts) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var t = cd[0].t;\n var isClosest = (hovermode === 'closest');\n var isWaterfall = (trace.type === 'waterfall');\n var maxHoverDistance = pointData.maxHoverDistance;\n var maxSpikeDistance = pointData.maxSpikeDistance;\n\n var posVal, sizeVal, posLetter, sizeLetter, dx, dy, pRangeCalc;\n\n if(trace.orientation === 'h') {\n posVal = yval;\n sizeVal = xval;\n posLetter = 'y';\n sizeLetter = 'x';\n dx = sizeFn;\n dy = positionFn;\n } else {\n posVal = xval;\n sizeVal = yval;\n posLetter = 'x';\n sizeLetter = 'y';\n dy = sizeFn;\n dx = positionFn;\n }\n\n var period = trace[posLetter + 'period'];\n var isClosestOrPeriod = isClosest || period;\n\n function thisBarMinPos(di) { return thisBarExtPos(di, -1); }\n function thisBarMaxPos(di) { return thisBarExtPos(di, 1); }\n\n function thisBarExtPos(di, sgn) {\n var w = di.w;\n\n return di[posLetter] + sgn * w / 2;\n }\n\n function periodLength(di) {\n return di[posLetter + 'End'] - di[posLetter + 'Start'];\n }\n\n var minPos = isClosest ?\n thisBarMinPos : period ?\n function(di) {\n return di.p - periodLength(di) / 2;\n } :\n function(di) {\n /*\n * In compare mode, accept a bar if you're on it *or* its group.\n * Nearly always it's the group that matters, but in case the bar\n * was explicitly set wider than its group we'd better accept the\n * whole bar.\n *\n * use `bardelta` instead of `bargroupwidth` so we accept hover\n * in the gap. That way hover doesn't flash on and off as you\n * mouse over the plot in compare modes.\n * In 'closest' mode though the flashing seems inevitable,\n * without far more complex logic\n */\n return Math.min(thisBarMinPos(di), di.p - t.bardelta / 2);\n };\n\n var maxPos = isClosest ?\n thisBarMaxPos : period ?\n function(di) {\n return di.p + periodLength(di) / 2;\n } :\n function(di) {\n return Math.max(thisBarMaxPos(di), di.p + t.bardelta / 2);\n };\n\n function inbox(_minPos, _maxPos, maxDistance) {\n if(opts.finiteRange) maxDistance = 0;\n\n // add a little to the pseudo-distance for wider bars, so that like scatter,\n // if you are over two overlapping bars, the narrower one wins.\n return Fx.inbox(_minPos - posVal, _maxPos - posVal,\n maxDistance + Math.min(1, Math.abs(_maxPos - _minPos) / pRangeCalc) - 1);\n }\n\n function positionFn(di) {\n return inbox(minPos(di), maxPos(di), maxHoverDistance);\n }\n\n function thisBarPositionFn(di) {\n return inbox(thisBarMinPos(di), thisBarMaxPos(di), maxSpikeDistance);\n }\n\n function getSize(di) {\n var s = di[sizeLetter];\n\n if(isWaterfall) {\n var rawS = Math.abs(di.rawS) || 0;\n if(sizeVal > 0) {\n s += rawS;\n } else if(sizeVal < 0) {\n s -= rawS;\n }\n }\n\n return s;\n }\n\n function sizeFn(di) {\n var v = sizeVal;\n var b = di.b;\n var s = getSize(di);\n\n // add a gradient so hovering near the end of a\n // bar makes it a little closer match\n return Fx.inbox(b - v, s - v, maxHoverDistance + (s - v) / (s - b) - 1);\n }\n\n function thisBarSizeFn(di) {\n var v = sizeVal;\n var b = di.b;\n var s = getSize(di);\n\n // add a gradient so hovering near the end of a\n // bar makes it a little closer match\n return Fx.inbox(b - v, s - v, maxSpikeDistance + (s - v) / (s - b) - 1);\n }\n\n var pa = pointData[posLetter + 'a'];\n var sa = pointData[sizeLetter + 'a'];\n\n pRangeCalc = Math.abs(pa.r2c(pa.range[1]) - pa.r2c(pa.range[0]));\n\n function dxy(di) { return (dx(di) + dy(di)) / 2; }\n var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n Fx.getClosest(cd, distfn, pointData);\n\n // skip the rest (for this trace) if we didn't find a close point\n if(pointData.index === false) return;\n\n // skip points inside axis rangebreaks\n if(cd[pointData.index].p === BADNUM) return;\n\n // if we get here and we're not in 'closest' mode, push min/max pos back\n // onto the group - even though that means occasionally the mouse will be\n // over the hover label.\n if(!isClosestOrPeriod) {\n minPos = function(di) {\n return Math.min(thisBarMinPos(di), di.p - t.bargroupwidth / 2);\n };\n maxPos = function(di) {\n return Math.max(thisBarMaxPos(di), di.p + t.bargroupwidth / 2);\n };\n }\n\n // the closest data point\n var index = pointData.index;\n var di = cd[index];\n\n var size = (trace.base) ? di.b + di.s : di.s;\n pointData[sizeLetter + '0'] = pointData[sizeLetter + '1'] = sa.c2p(di[sizeLetter], true);\n pointData[sizeLetter + 'LabelVal'] = size;\n\n var extent = t.extents[t.extents.round(di.p)];\n pointData[posLetter + '0'] = pa.c2p(isClosest ? minPos(di) : extent[0], true);\n pointData[posLetter + '1'] = pa.c2p(isClosest ? maxPos(di) : extent[1], true);\n\n var hasPeriod = di.orig_p !== undefined;\n pointData[posLetter + 'LabelVal'] = hasPeriod ? di.orig_p : di.p;\n\n pointData.labelLabel = hoverLabelText(pa, pointData[posLetter + 'LabelVal'], trace[posLetter + 'hoverformat']);\n pointData.valueLabel = hoverLabelText(sa, pointData[sizeLetter + 'LabelVal'], trace[sizeLetter + 'hoverformat']);\n pointData.baseLabel = hoverLabelText(sa, di.b, trace[sizeLetter + 'hoverformat']);\n\n // spikelines always want \"closest\" distance regardless of hovermode\n pointData.spikeDistance = (thisBarSizeFn(di) + thisBarPositionFn(di)) / 2;\n // they also want to point to the data value, regardless of where the label goes\n // in case of bars shifted within groups\n pointData[posLetter + 'Spike'] = pa.c2p(di.p, true);\n\n fillText(di, trace, pointData);\n pointData.hovertemplate = trace.hovertemplate;\n\n return pointData;\n}\n\nfunction getTraceColor(trace, di) {\n var mc = di.mcc || trace.marker.color;\n var mlc = di.mlcc || trace.marker.line.color;\n var mlw = getLineWidth(trace, di);\n\n if(Color.opacity(mc)) return mc;\n else if(Color.opacity(mlc) && mlw) return mlc;\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints,\n hoverOnBars: hoverOnBars,\n getTraceColor: getTraceColor\n};\n","'use strict';\n\nvar isNumeric = require('fast-isnumeric');\n\nvar Lib = require('../../lib');\nvar Color = require('../../components/color');\nvar Registry = require('../../registry');\n\nvar handleXYDefaults = require('../scatter/xy_defaults');\nvar handlePeriodDefaults = require('../scatter/period_defaults');\nvar handleStyleDefaults = require('./style_defaults');\nvar handleGroupingDefaults = require('../scatter/grouping_defaults');\nvar attributes = require('./attributes');\n\nvar coerceFont = Lib.coerceFont;\n\nfunction supplyDefaults(traceIn, traceOut, defaultColor, layout) {\n function coerce(attr, dflt) {\n return Lib.coerce(traceIn, traceOut, attributes, attr, dflt);\n }\n\n var len = handleXYDefaults(traceIn, traceOut, layout, coerce);\n if(!len) {\n traceOut.visible = false;\n return;\n }\n\n handlePeriodDefaults(traceIn, traceOut, layout, coerce);\n coerce('xhoverformat');\n coerce('yhoverformat');\n\n coerce('orientation', (traceOut.x && !traceOut.y) ? 'h' : 'v');\n coerce('base');\n coerce('offset');\n coerce('width');\n\n coerce('text');\n coerce('hovertext');\n coerce('hovertemplate');\n\n var textposition = coerce('textposition');\n handleText(traceIn, traceOut, layout, coerce, textposition, {\n moduleHasSelected: true,\n moduleHasUnselected: true,\n moduleHasConstrain: true,\n moduleHasCliponaxis: true,\n moduleHasTextangle: true,\n moduleHasInsideanchor: true\n });\n\n handleStyleDefaults(traceIn, traceOut, coerce, defaultColor, layout);\n var lineColor = (traceOut.marker.line || {}).color;\n\n // override defaultColor for error bars with defaultLine\n var errorBarsSupplyDefaults = Registry.getComponentMethod('errorbars', 'supplyDefaults');\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'y'});\n errorBarsSupplyDefaults(traceIn, traceOut, lineColor || Color.defaultLine, {axis: 'x', inherit: 'y'});\n\n Lib.coerceSelectionMarkerOpacity(traceOut, coerce);\n}\n\nfunction crossTraceDefaults(fullData, fullLayout) {\n var traceIn, traceOut;\n\n function coerce(attr, dflt) {\n return Lib.coerce(traceOut._input, traceOut, attributes, attr, dflt);\n }\n\n for(var i = 0; i < fullData.length; i++) {\n traceOut = fullData[i];\n\n if(traceOut.type === 'bar') {\n traceIn = traceOut._input;\n // `marker.cornerradius` needs to be coerced here rather than in handleStyleDefaults()\n // because it needs to happen after `layout.barcornerradius` has been coerced\n var r = coerce('marker.cornerradius', fullLayout.barcornerradius);\n if(traceOut.marker) {\n traceOut.marker.cornerradius = validateCornerradius(r);\n }\n\n if(fullLayout.barmode === 'group') {\n handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);\n }\n }\n }\n}\n\n// Returns a value equivalent to the given cornerradius value, if valid;\n// otherwise returns`undefined`.\n// Valid cornerradius values must be either:\n// - a numeric value (string or number) >= 0, or\n// - a string consisting of a number >= 0 followed by a % sign\n// If the given cornerradius value is a numeric string, it will be converted\n// to a number.\nfunction validateCornerradius(r) {\n if(isNumeric(r)) {\n r = +r;\n if(r >= 0) return r;\n } else if(typeof r === 'string') {\n r = r.trim();\n if(r.slice(-1) === '%' && isNumeric(r.slice(0, -1))) {\n r = +r.slice(0, -1);\n if(r >= 0) return r + '%';\n }\n }\n return undefined;\n}\n\nfunction handleText(traceIn, traceOut, layout, coerce, textposition, opts) {\n opts = opts || {};\n var moduleHasSelected = !(opts.moduleHasSelected === false);\n var moduleHasUnselected = !(opts.moduleHasUnselected === false);\n var moduleHasConstrain = !(opts.moduleHasConstrain === false);\n var moduleHasCliponaxis = !(opts.moduleHasCliponaxis === false);\n var moduleHasTextangle = !(opts.moduleHasTextangle === false);\n var moduleHasInsideanchor = !(opts.moduleHasInsideanchor === false);\n var hasPathbar = !!opts.hasPathbar;\n\n var hasBoth = Array.isArray(textposition) || textposition === 'auto';\n var hasInside = hasBoth || textposition === 'inside';\n var hasOutside = hasBoth || textposition === 'outside';\n\n if(hasInside || hasOutside) {\n var dfltFont = coerceFont(coerce, 'textfont', layout.font);\n\n // Note that coercing `insidetextfont` is always needed –\n // even if `textposition` is `outside` for each trace – since\n // an outside label can become an inside one, for example because\n // of a bar being stacked on top of it.\n var insideTextFontDefault = Lib.extendFlat({}, dfltFont);\n var isTraceTextfontColorSet = traceIn.textfont && traceIn.textfont.color;\n var isColorInheritedFromLayoutFont = !isTraceTextfontColorSet;\n if(isColorInheritedFromLayoutFont) {\n delete insideTextFontDefault.color;\n }\n coerceFont(coerce, 'insidetextfont', insideTextFontDefault);\n\n if(hasPathbar) {\n var pathbarTextFontDefault = Lib.extendFlat({}, dfltFont);\n if(isColorInheritedFromLayoutFont) {\n delete pathbarTextFontDefault.color;\n }\n coerceFont(coerce, 'pathbar.textfont', pathbarTextFontDefault);\n }\n\n if(hasOutside) coerceFont(coerce, 'outsidetextfont', dfltFont);\n\n if(moduleHasSelected) coerce('selected.textfont.color');\n if(moduleHasUnselected) coerce('unselected.textfont.color');\n if(moduleHasConstrain) coerce('constraintext');\n if(moduleHasCliponaxis) coerce('cliponaxis');\n if(moduleHasTextangle) coerce('textangle');\n\n coerce('texttemplate');\n }\n\n if(hasInside) {\n if(moduleHasInsideanchor) coerce('insidetextanchor');\n }\n}\n\nmodule.exports = {\n supplyDefaults: supplyDefaults,\n crossTraceDefaults: crossTraceDefaults,\n handleText: handleText,\n validateCornerradius: validateCornerradius,\n};\n","'use strict';\n\nvar Registry = require('../../registry');\nvar isArrayOrTypedArray = require('../../lib').isArrayOrTypedArray;\n\nmodule.exports = function makeBoundArray(trace, arrayIn, v0In, dvIn, numbricks, ax) {\n var arrayOut = [];\n var isContour = Registry.traceIs(trace, 'contour');\n var isHist = Registry.traceIs(trace, 'histogram');\n var isGL2D = Registry.traceIs(trace, 'gl2d');\n var v0;\n var dv;\n var i;\n\n var isArrayOfTwoItemsOrMore = isArrayOrTypedArray(arrayIn) && arrayIn.length > 1;\n\n if(isArrayOfTwoItemsOrMore && !isHist && (ax.type !== 'category')) {\n var len = arrayIn.length;\n\n // given vals are brick centers\n // hopefully length === numbricks, but use this method even if too few are supplied\n // and extend it linearly based on the last two points\n if(len <= numbricks) {\n // contour plots only want the centers\n if(isContour || isGL2D) arrayOut = Array.from(arrayIn).slice(0, numbricks);\n else if(numbricks === 1) {\n if(ax.type === 'log') {\n arrayOut = [0.5 * arrayIn[0], 2 * arrayIn[0]];\n } else {\n arrayOut = [arrayIn[0] - 0.5, arrayIn[0] + 0.5];\n }\n } else if(ax.type === 'log') {\n arrayOut = [Math.pow(arrayIn[0], 1.5) / Math.pow(arrayIn[1], 0.5)];\n\n for(i = 1; i < len; i++) {\n // Geomean\n arrayOut.push(Math.sqrt(arrayIn[i - 1] * arrayIn[i]));\n }\n\n arrayOut.push(Math.pow(arrayIn[len - 1], 1.5) / Math.pow(arrayIn[len - 2], 0.5));\n } else {\n arrayOut = [1.5 * arrayIn[0] - 0.5 * arrayIn[1]];\n\n for(i = 1; i < len; i++) {\n // Arithmetic mean\n arrayOut.push((arrayIn[i - 1] + arrayIn[i]) * 0.5);\n }\n\n arrayOut.push(1.5 * arrayIn[len - 1] - 0.5 * arrayIn[len - 2]);\n }\n\n if(len < numbricks) {\n var lastPt = arrayOut[arrayOut.length - 1];\n var delta; // either multiplicative delta (log axis type) or arithmetic delta (all other axis types)\n if(ax.type === 'log') {\n delta = lastPt / arrayOut[arrayOut.length - 2];\n\n for(i = len; i < numbricks; i++) {\n lastPt *= delta;\n arrayOut.push(lastPt);\n }\n } else {\n delta = lastPt - arrayOut[arrayOut.length - 2];\n\n for(i = len; i < numbricks; i++) {\n lastPt += delta;\n arrayOut.push(lastPt);\n }\n }\n }\n } else {\n // hopefully length === numbricks+1, but do something regardless:\n // given vals are brick boundaries\n return isContour ?\n arrayIn.slice(0, numbricks) : // we must be strict for contours\n arrayIn.slice(0, numbricks + 1);\n }\n } else {\n var calendar = trace[ax._id.charAt(0) + 'calendar'];\n\n if(isHist) {\n v0 = ax.r2c(v0In, 0, calendar);\n } else {\n if(isArrayOrTypedArray(arrayIn) && arrayIn.length === 1) {\n v0 = arrayIn[0];\n } else if(v0In === undefined) {\n v0 = 0;\n } else {\n var fn = ax.type === 'log' ? ax.d2c : ax.r2c;\n v0 = fn(v0In, 0, calendar);\n }\n }\n\n dv = dvIn || 1;\n\n for(i = (isContour || isGL2D) ? 0 : -0.5; i < numbricks; i++) {\n arrayOut.push(v0 + dv * i);\n }\n }\n\n return arrayOut;\n};\n","'use strict';\n\nvar Registry = require('../../registry');\nvar Lib = require('../../lib');\nvar layoutAttributes = require('./layout_attributes');\n\nfunction _supply(layoutIn, layoutOut, fullData, coerce, traceType) {\n var category = traceType + 'Layout';\n var hasTraceType = false;\n\n for(var i = 0; i < fullData.length; i++) {\n var trace = fullData[i];\n\n if(Registry.traceIs(trace, category)) {\n hasTraceType = true;\n break;\n }\n }\n if(!hasTraceType) return;\n\n coerce(traceType + 'mode');\n coerce(traceType + 'gap');\n coerce(traceType + 'groupgap');\n}\n\nfunction supplyLayoutDefaults(layoutIn, layoutOut, fullData) {\n function coerce(attr, dflt) {\n return Lib.coerce(layoutIn, layoutOut, layoutAttributes, attr, dflt);\n }\n _supply(layoutIn, layoutOut, fullData, coerce, 'box');\n}\n\nmodule.exports = {\n supplyLayoutDefaults: supplyLayoutDefaults,\n _supply: _supply\n};\n","'use strict';\n\nvar hasColorscale = require('../../components/colorscale/helpers').hasColorscale;\nvar calcColorscale = require('../../components/colorscale/calc');\n\nvar subTypes = require('./subtypes');\n\nmodule.exports = function calcMarkerColorscale(gd, trace) {\n if(subTypes.hasLines(trace) && hasColorscale(trace, 'line')) {\n calcColorscale(gd, trace, {\n vals: trace.line.color,\n containerStr: 'line',\n cLetter: 'c'\n });\n }\n\n if(subTypes.hasMarkers(trace)) {\n if(hasColorscale(trace, 'marker')) {\n calcColorscale(gd, trace, {\n vals: trace.marker.color,\n containerStr: 'marker',\n cLetter: 'c'\n });\n }\n if(hasColorscale(trace, 'marker.line')) {\n calcColorscale(gd, trace, {\n vals: trace.marker.line.color,\n containerStr: 'marker.line',\n cLetter: 'c'\n });\n }\n }\n};\n","'use strict';\n\nvar d3 = require('@plotly/d3');\n\nvar Lib = require('../lib');\nvar Drawing = require('../components/drawing');\nvar Color = require('../components/color');\n\nvar xmlnsNamespaces = require('../constants/xmlns_namespaces');\nvar DOUBLEQUOTE_REGEX = /\"/g;\nvar DUMMY_SUB = 'TOBESTRIPPED';\nvar DUMMY_REGEX = new RegExp('(\"' + DUMMY_SUB + ')|(' + DUMMY_SUB + '\")', 'g');\n\nfunction htmlEntityDecode(s) {\n var hiddenDiv = d3.select('body').append('div').style({display: 'none'}).html('');\n var replaced = s.replace(/(&[^;]*;)/gi, function(d) {\n if(d === '<') { return '<'; } // special handling for brackets\n if(d === '&rt;') { return '>'; }\n if(d.indexOf('<') !== -1 || d.indexOf('>') !== -1) { return ''; }\n return hiddenDiv.html(d).text(); // everything else, let the browser decode it to unicode\n });\n hiddenDiv.remove();\n return replaced;\n}\n\nfunction xmlEntityEncode(str) {\n return str.replace(/&(?!\\w+;|\\#[0-9]+;| \\#x[0-9A-F]+;)/g, '&');\n}\n\nmodule.exports = function toSVG(gd, format, scale) {\n var fullLayout = gd._fullLayout;\n var svg = fullLayout._paper;\n var toppaper = fullLayout._toppaper;\n var width = fullLayout.width;\n var height = fullLayout.height;\n var i;\n\n // make background color a rect in the svg, then revert after scraping\n // all other alterations have been dealt with by properly preparing the svg\n // in the first place... like setting cursors with css classes so we don't\n // have to remove them, and providing the right namespaces in the svg to\n // begin with\n svg.insert('rect', ':first-child')\n .call(Drawing.setRect, 0, 0, width, height)\n .call(Color.fill, fullLayout.paper_bgcolor);\n\n // subplot-specific to-SVG methods\n // which notably add the contents of the gl-container\n // into the main svg node\n var basePlotModules = fullLayout._basePlotModules || [];\n for(i = 0; i < basePlotModules.length; i++) {\n var _module = basePlotModules[i];\n\n if(_module.toSVG) _module.toSVG(gd);\n }\n\n // add top items above them assumes everything in toppaper is either\n // a group or a defs, and if it's empty (like hoverlayer) we can ignore it.\n if(toppaper) {\n var nodes = toppaper.node().childNodes;\n\n // make copy of nodes as childNodes prop gets mutated in loop below\n var topGroups = Array.prototype.slice.call(nodes);\n\n for(i = 0; i < topGroups.length; i++) {\n var topGroup = topGroups[i];\n\n if(topGroup.childNodes.length) svg.node().appendChild(topGroup);\n }\n }\n\n // remove draglayer for Adobe Illustrator compatibility\n if(fullLayout._draggers) {\n fullLayout._draggers.remove();\n }\n\n // in case the svg element had an explicit background color, remove this\n // we want the rect to get the color so it's the right size; svg bg will\n // fill whatever container it's displayed in regardless of plot size.\n svg.node().style.background = '';\n\n svg.selectAll('text')\n .attr({'data-unformatted': null, 'data-math': null})\n .each(function() {\n var txt = d3.select(this);\n\n // hidden text is pre-formatting mathjax, the browser ignores it\n // but in a static plot it's useless and it can confuse batik\n // we've tried to standardize on display:none but make sure we still\n // catch visibility:hidden if it ever arises\n if(this.style.visibility === 'hidden' || this.style.display === 'none') {\n txt.remove();\n return;\n } else {\n // clear other visibility/display values to default\n // to not potentially confuse non-browser SVG implementations\n txt.style({visibility: null, display: null});\n }\n\n // Font family styles break things because of quotation marks,\n // so we must remove them *after* the SVG DOM has been serialized\n // to a string (browsers convert singles back)\n var ff = this.style.fontFamily;\n if(ff && ff.indexOf('\"') !== -1) {\n txt.style('font-family', ff.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n }\n });\n\n svg.selectAll('.gradient_filled,.pattern_filled').each(function() {\n var pt = d3.select(this);\n\n // similar to font family styles above,\n // we must remove \" after the SVG DOM has been serialized\n var fill = this.style.fill;\n if(fill && fill.indexOf('url(') !== -1) {\n pt.style('fill', fill.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n }\n\n var stroke = this.style.stroke;\n if(stroke && stroke.indexOf('url(') !== -1) {\n pt.style('stroke', stroke.replace(DOUBLEQUOTE_REGEX, DUMMY_SUB));\n }\n });\n\n if(format === 'pdf' || format === 'eps') {\n // these formats make the extra line MathJax adds around symbols look super thick in some cases\n // it looks better if this is removed entirely.\n svg.selectAll('#MathJax_SVG_glyphs path')\n .attr('stroke-width', 0);\n }\n\n // fix for IE namespacing quirk?\n // http://stackoverflow.com/questions/19610089/unwanted-namespaces-on-svg-markup-when-using-xmlserializer-in-javascript-with-ie\n svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns', xmlnsNamespaces.svg);\n svg.node().setAttributeNS(xmlnsNamespaces.xmlns, 'xmlns:xlink', xmlnsNamespaces.xlink);\n\n if(format === 'svg' && scale) {\n svg.attr('width', scale * width);\n svg.attr('height', scale * height);\n svg.attr('viewBox', '0 0 ' + width + ' ' + height);\n }\n\n var s = new window.XMLSerializer().serializeToString(svg.node());\n s = htmlEntityDecode(s);\n s = xmlEntityEncode(s);\n\n // Fix quotations around font strings and gradient URLs\n s = s.replace(DUMMY_REGEX, '\\'');\n\n // Do we need this process now that IE9 and IE10 are not supported?\n\n // IE is very strict, so we will need to clean\n // svg with the following regex\n // yes this is messy, but do not know a better way\n // Even with this IE will not work due to tainted canvas\n // see https://github.com/kangax/fabric.js/issues/1957\n // http://stackoverflow.com/questions/18112047/canvas-todataurl-working-in-all-browsers-except-ie10\n // Leave here just in case the CORS/tainted IE issue gets resolved\n if(Lib.isIE()) {\n // replace double quote with single quote\n s = s.replace(/\"/gi, '\\'');\n // url in svg are single quoted\n // since we changed double to single\n // we'll need to change these to double-quoted\n s = s.replace(/(\\('#)([^']*)('\\))/gi, '(\\\"#$2\\\")');\n // font names with spaces will be escaped single-quoted\n // we'll need to change these to double-quoted\n s = s.replace(/(\\\\')/gi, '\\\"');\n }\n\n return s;\n};\n","'use strict';\n\nvar scatterAttrs = require('../scatter/attributes');\nvar baseAttrs = require('../../plots/attributes');\nvar fontAttrs = require('../../plots/font_attributes');\nvar axisHoverFormat = require('../../plots/cartesian/axis_format_attributes').axisHoverFormat;\nvar hovertemplateAttrs = require('../../plots/template_attributes').hovertemplateAttrs;\nvar texttemplateAttrs = require('../../plots/template_attributes').texttemplateAttrs;\nvar colorScaleAttrs = require('../../components/colorscale/attributes');\n\nvar extendFlat = require('../../lib/extend').extendFlat;\n\nmodule.exports = extendFlat({\n z: {\n valType: 'data_array',\n editType: 'calc',\n description: 'Sets the z data.'\n },\n x: extendFlat({}, scatterAttrs.x, {impliedEdits: {xtype: 'array'}}),\n x0: extendFlat({}, scatterAttrs.x0, {impliedEdits: {xtype: 'scaled'}}),\n dx: extendFlat({}, scatterAttrs.dx, {impliedEdits: {xtype: 'scaled'}}),\n y: extendFlat({}, scatterAttrs.y, {impliedEdits: {ytype: 'array'}}),\n y0: extendFlat({}, scatterAttrs.y0, {impliedEdits: {ytype: 'scaled'}}),\n dy: extendFlat({}, scatterAttrs.dy, {impliedEdits: {ytype: 'scaled'}}),\n\n xperiod: extendFlat({}, scatterAttrs.xperiod, {impliedEdits: {xtype: 'scaled'}}),\n yperiod: extendFlat({}, scatterAttrs.yperiod, {impliedEdits: {ytype: 'scaled'}}),\n xperiod0: extendFlat({}, scatterAttrs.xperiod0, {impliedEdits: {xtype: 'scaled'}}),\n yperiod0: extendFlat({}, scatterAttrs.yperiod0, {impliedEdits: {ytype: 'scaled'}}),\n xperiodalignment: extendFlat({}, scatterAttrs.xperiodalignment, {impliedEdits: {xtype: 'scaled'}}),\n yperiodalignment: extendFlat({}, scatterAttrs.yperiodalignment, {impliedEdits: {ytype: 'scaled'}}),\n\n text: {\n valType: 'data_array',\n editType: 'calc',\n description: 'Sets the text elements associated with each z value.'\n },\n hovertext: {\n valType: 'data_array',\n editType: 'calc',\n description: 'Same as `text`.'\n },\n transpose: {\n valType: 'boolean',\n dflt: false,\n editType: 'calc',\n description: 'Transposes the z data.'\n },\n xtype: {\n valType: 'enumerated',\n values: ['array', 'scaled'],\n editType: 'calc+clearAxisTypes',\n description: [\n 'If *array*, the heatmap\\'s x coordinates are given by *x*',\n '(the default behavior when `x` is provided).',\n 'If *scaled*, the heatmap\\'s x coordinates are given by *x0* and *dx*',\n '(the default behavior when `x` is not provided).'\n ].join(' ')\n },\n ytype: {\n valType: 'enumerated',\n values: ['array', 'scaled'],\n editType: 'calc+clearAxisTypes',\n description: [\n 'If *array*, the heatmap\\'s y coordinates are given by *y*',\n '(the default behavior when `y` is provided)',\n 'If *scaled*, the heatmap\\'s y coordinates are given by *y0* and *dy*',\n '(the default behavior when `y` is not provided)'\n ].join(' ')\n },\n zsmooth: {\n valType: 'enumerated',\n values: ['fast', 'best', false],\n dflt: false,\n editType: 'calc',\n description: [\n 'Picks a smoothing algorithm use to smooth `z` data.'\n ].join(' ')\n },\n hoverongaps: {\n valType: 'boolean',\n dflt: true,\n editType: 'none',\n description: [\n 'Determines whether or not gaps',\n '(i.e. {nan} or missing values)',\n 'in the `z` data have hover labels associated with them.'\n ].join(' ')\n },\n connectgaps: {\n valType: 'boolean',\n editType: 'calc',\n description: [\n 'Determines whether or not gaps',\n '(i.e. {nan} or missing values)',\n 'in the `z` data are filled in.',\n 'It is defaulted to true if `z` is a',\n 'one dimensional array and `zsmooth` is not false;',\n 'otherwise it is defaulted to false.'\n ].join(' ')\n },\n xgap: {\n valType: 'number',\n dflt: 0,\n min: 0,\n editType: 'plot',\n description: 'Sets the horizontal gap (in pixels) between bricks.'\n },\n ygap: {\n valType: 'number',\n dflt: 0,\n min: 0,\n editType: 'plot',\n description: 'Sets the vertical gap (in pixels) between bricks.'\n },\n xhoverformat: axisHoverFormat('x'),\n yhoverformat: axisHoverFormat('y'),\n zhoverformat: axisHoverFormat('z', 1),\n\n hovertemplate: hovertemplateAttrs(),\n texttemplate: texttemplateAttrs({\n arrayOk: false,\n editType: 'plot'\n }, {\n keys: ['x', 'y', 'z', 'text']\n }),\n textfont: fontAttrs({\n editType: 'plot',\n autoSize: true,\n autoColor: true,\n colorEditType: 'style',\n description: 'Sets the text font.'\n }),\n\n showlegend: extendFlat({}, baseAttrs.showlegend, {dflt: false})\n}, {\n transforms: undefined\n},\n colorScaleAttrs('', {cLetter: 'z', autoColorDflt: false})\n);\n","'use strict';\n\nvar Lib = require('../../lib');\nvar Axes = require('../../plots/cartesian/axes');\n\nvar binFunctions = require('../histogram/bin_functions');\nvar normFunctions = require('../histogram/norm_functions');\nvar doAvg = require('../histogram/average');\nvar getBinSpanLabelRound = require('../histogram/bin_label_vals');\nvar calcAllAutoBins = require('../histogram/calc').calcAllAutoBins;\n\nmodule.exports = function calc(gd, trace) {\n var xa = Axes.getFromId(gd, trace.xaxis);\n var ya = Axes.getFromId(gd, trace.yaxis);\n\n var xcalendar = trace.xcalendar;\n var ycalendar = trace.ycalendar;\n var xr2c = function(v) { return xa.r2c(v, 0, xcalendar); };\n var yr2c = function(v) { return ya.r2c(v, 0, ycalendar); };\n var xc2r = function(v) { return xa.c2r(v, 0, xcalendar); };\n var yc2r = function(v) { return ya.c2r(v, 0, ycalendar); };\n\n var i, j, n, m;\n\n // calculate the bins\n var xBinsAndPos = calcAllAutoBins(gd, trace, xa, 'x');\n var xBinSpec = xBinsAndPos[0];\n var xPos0 = xBinsAndPos[1];\n var yBinsAndPos = calcAllAutoBins(gd, trace, ya, 'y');\n var yBinSpec = yBinsAndPos[0];\n var yPos0 = yBinsAndPos[1];\n\n var serieslen = trace._length;\n if(xPos0.length > serieslen) xPos0.splice(serieslen, xPos0.length - serieslen);\n if(yPos0.length > serieslen) yPos0.splice(serieslen, yPos0.length - serieslen);\n\n // make the empty bin array & scale the map\n var z = [];\n var onecol = [];\n var zerocol = [];\n var nonuniformBinsX = typeof xBinSpec.size === 'string';\n var nonuniformBinsY = typeof yBinSpec.size === 'string';\n var xEdges = [];\n var yEdges = [];\n var xbins = nonuniformBinsX ? xEdges : xBinSpec;\n var ybins = nonuniformBinsY ? yEdges : yBinSpec;\n var total = 0;\n var counts = [];\n var inputPoints = [];\n var norm = trace.histnorm;\n var func = trace.histfunc;\n var densitynorm = norm.indexOf('density') !== -1;\n var extremefunc = func === 'max' || func === 'min';\n var sizeinit = extremefunc ? null : 0;\n var binfunc = binFunctions.count;\n var normfunc = normFunctions[norm];\n var doavg = false;\n var xinc = [];\n var yinc = [];\n\n // set a binning function other than count?\n // for binning functions: check first for 'z',\n // then 'mc' in case we had a colored scatter plot\n // and want to transfer these colors to the 2D histo\n // TODO: axe this, make it the responsibility of the app changing type? or an impliedEdit?\n var rawCounterData = ('z' in trace) ?\n trace.z :\n (('marker' in trace && Array.isArray(trace.marker.color)) ?\n trace.marker.color : '');\n if(rawCounterData && func !== 'count') {\n doavg = func === 'avg';\n binfunc = binFunctions[func];\n }\n\n // decrease end a little in case of rounding errors\n var xBinSize = xBinSpec.size;\n var xBinStart = xr2c(xBinSpec.start);\n var xBinEnd = xr2c(xBinSpec.end) +\n (xBinStart - Axes.tickIncrement(xBinStart, xBinSize, false, xcalendar)) / 1e6;\n\n for(i = xBinStart; i < xBinEnd; i = Axes.tickIncrement(i, xBinSize, false, xcalendar)) {\n onecol.push(sizeinit);\n xEdges.push(i);\n if(doavg) zerocol.push(0);\n }\n xEdges.push(i);\n\n var nx = onecol.length;\n var dx = (i - xBinStart) / nx;\n var x0 = xc2r(xBinStart + dx / 2);\n\n var yBinSize = yBinSpec.size;\n var yBinStart = yr2c(yBinSpec.start);\n var yBinEnd = yr2c(yBinSpec.end) +\n (yBinStart - Axes.tickIncrement(yBinStart, yBinSize, false, ycalendar)) / 1e6;\n\n for(i = yBinStart; i < yBinEnd; i = Axes.tickIncrement(i, yBinSize, false, ycalendar)) {\n z.push(onecol.slice());\n yEdges.push(i);\n var ipCol = new Array(nx);\n for(j = 0; j < nx; j++) ipCol[j] = [];\n inputPoints.push(ipCol);\n if(doavg) counts.push(zerocol.slice());\n }\n yEdges.push(i);\n\n var ny = z.length;\n var dy = (i - yBinStart) / ny;\n var y0 = yc2r(yBinStart + dy / 2);\n\n if(densitynorm) {\n xinc = makeIncrements(onecol.length, xbins, dx, nonuniformBinsX);\n yinc = makeIncrements(z.length, ybins, dy, nonuniformBinsY);\n }\n\n // for date axes we need bin bounds to be calcdata. For nonuniform bins\n // we already have this, but uniform with start/end/size they're still strings.\n if(!nonuniformBinsX && xa.type === 'date') xbins = binsToCalc(xr2c, xbins);\n if(!nonuniformBinsY && ya.type === 'date') ybins = binsToCalc(yr2c, ybins);\n\n // put data into bins\n var uniqueValsPerX = true;\n var uniqueValsPerY = true;\n var xVals = new Array(nx);\n var yVals = new Array(ny);\n var xGapLow = Infinity;\n var xGapHigh = Infinity;\n var yGapLow = Infinity;\n var yGapHigh = Infinity;\n for(i = 0; i < serieslen; i++) {\n var xi = xPos0[i];\n var yi = yPos0[i];\n n = Lib.findBin(xi, xbins);\n m = Lib.findBin(yi, ybins);\n if(n >= 0 && n < nx && m >= 0 && m < ny) {\n total += binfunc(n, i, z[m], rawCounterData, counts[m]);\n inputPoints[m][n].push(i);\n\n if(uniqueValsPerX) {\n if(xVals[n] === undefined) xVals[n] = xi;\n else if(xVals[n] !== xi) uniqueValsPerX = false;\n }\n if(uniqueValsPerY) {\n if(yVals[m] === undefined) yVals[m] = yi;\n else if(yVals[m] !== yi) uniqueValsPerY = false;\n }\n\n xGapLow = Math.min(xGapLow, xi - xEdges[n]);\n xGapHigh = Math.min(xGapHigh, xEdges[n + 1] - xi);\n yGapLow = Math.min(yGapLow, yi - yEdges[m]);\n yGapHigh = Math.min(yGapHigh, yEdges[m + 1] - yi);\n }\n }\n // normalize, if needed\n if(doavg) {\n for(m = 0; m < ny; m++) total += doAvg(z[m], counts[m]);\n }\n if(normfunc) {\n for(m = 0; m < ny; m++) normfunc(z[m], total, xinc, yinc[m]);\n }\n\n return {\n x: xPos0,\n xRanges: getRanges(xEdges, uniqueValsPerX && xVals, xGapLow, xGapHigh, xa, xcalendar),\n x0: x0,\n dx: dx,\n y: yPos0,\n yRanges: getRanges(yEdges, uniqueValsPerY && yVals, yGapLow, yGapHigh, ya, ycalendar),\n y0: y0,\n dy: dy,\n z: z,\n pts: inputPoints\n };\n};\n\nfunction makeIncrements(len, bins, dv, nonuniform) {\n var out = new Array(len);\n var i;\n if(nonuniform) {\n for(i = 0; i < len; i++) out[i] = 1 / (bins[i + 1] - bins[i]);\n } else {\n var inc = 1 / dv;\n for(i = 0; i < len; i++) out[i] = inc;\n }\n return out;\n}\n\nfunction binsToCalc(r2c, bins) {\n return {\n start: r2c(bins.start),\n end: r2c(bins.end),\n size: bins.size\n };\n}\n\nfunction getRanges(edges, uniqueVals, gapLow, gapHigh, ax, calendar) {\n var i;\n var len = edges.length - 1;\n var out = new Array(len);\n var roundFn = getBinSpanLabelRound(gapLow, gapHigh, edges, ax, calendar);\n\n for(i = 0; i < len; i++) {\n var v = (uniqueVals || [])[i];\n out[i] = v === undefined ?\n [roundFn(edges[i]), roundFn(edges[i + 1], true)] :\n [v, v];\n }\n return out;\n}\n","'use strict';\n\nvar Axes = require('../../plots/cartesian/axes');\nvar Lib = require('../../lib');\nvar Fx = require('../../components/fx');\nvar Color = require('../../components/color');\nvar fillText = Lib.fillText;\n\nfunction hoverPoints(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var trace = cd[0].trace;\n var hoveron = trace.hoveron;\n var closeBoxData = [];\n var closePtData;\n\n if(hoveron.indexOf('boxes') !== -1) {\n closeBoxData = closeBoxData.concat(hoverOnBoxes(pointData, xval, yval, hovermode));\n }\n\n if(hoveron.indexOf('points') !== -1) {\n closePtData = hoverOnPoints(pointData, xval, yval);\n }\n\n // If there's a point in range and hoveron has points, show the best single point only.\n // If hoveron has boxes and there's no point in range (or hoveron doesn't have points), show the box stats.\n if(hovermode === 'closest') {\n if(closePtData) return [closePtData];\n return closeBoxData;\n }\n\n // Otherwise in compare mode, allow a point AND the box stats to be labeled\n // If there are multiple boxes in range (ie boxmode = 'overlay') we'll see stats for all of them.\n if(closePtData) {\n closeBoxData.push(closePtData);\n return closeBoxData;\n }\n return closeBoxData;\n}\n\nfunction hoverOnBoxes(pointData, xval, yval, hovermode) {\n var cd = pointData.cd;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var trace = cd[0].trace;\n var t = cd[0].t;\n var isViolin = trace.type === 'violin';\n\n var pLetter, vLetter, pAxis, vAxis, vVal, pVal, dx, dy, dPos,\n hoverPseudoDistance, spikePseudoDistance;\n\n var boxDelta = t.bdPos;\n var boxDeltaPos, boxDeltaNeg;\n var posAcceptance = t.wHover;\n var shiftPos = function(di) { return pAxis.c2l(di.pos) + t.bPos - pAxis.c2l(pVal); };\n\n if(isViolin && trace.side !== 'both') {\n if(trace.side === 'positive') {\n dPos = function(di) {\n var pos = shiftPos(di);\n return Fx.inbox(pos, pos + posAcceptance, hoverPseudoDistance);\n };\n boxDeltaPos = boxDelta;\n boxDeltaNeg = 0;\n }\n if(trace.side === 'negative') {\n dPos = function(di) {\n var pos = shiftPos(di);\n return Fx.inbox(pos - posAcceptance, pos, hoverPseudoDistance);\n };\n boxDeltaPos = 0;\n boxDeltaNeg = boxDelta;\n }\n } else {\n dPos = function(di) {\n var pos = shiftPos(di);\n return Fx.inbox(pos - posAcceptance, pos + posAcceptance, hoverPseudoDistance);\n };\n boxDeltaPos = boxDeltaNeg = boxDelta;\n }\n\n var dVal;\n\n if(isViolin) {\n dVal = function(di) {\n return Fx.inbox(di.span[0] - vVal, di.span[1] - vVal, hoverPseudoDistance);\n };\n } else {\n dVal = function(di) {\n return Fx.inbox(di.min - vVal, di.max - vVal, hoverPseudoDistance);\n };\n }\n\n if(trace.orientation === 'h') {\n vVal = xval;\n pVal = yval;\n dx = dVal;\n dy = dPos;\n pLetter = 'y';\n pAxis = ya;\n vLetter = 'x';\n vAxis = xa;\n } else {\n vVal = yval;\n pVal = xval;\n dx = dPos;\n dy = dVal;\n pLetter = 'x';\n pAxis = xa;\n vLetter = 'y';\n vAxis = ya;\n }\n\n // if two boxes are overlaying, let the narrowest one win\n var pseudoDistance = Math.min(1, boxDelta / Math.abs(pAxis.r2c(pAxis.range[1]) - pAxis.r2c(pAxis.range[0])));\n hoverPseudoDistance = pointData.maxHoverDistance - pseudoDistance;\n spikePseudoDistance = pointData.maxSpikeDistance - pseudoDistance;\n\n function dxy(di) { return (dx(di) + dy(di)) / 2; }\n var distfn = Fx.getDistanceFunction(hovermode, dx, dy, dxy);\n Fx.getClosest(cd, distfn, pointData);\n\n // skip the rest (for this trace) if we didn't find a close point\n // and create the item(s) in closedata for this point\n if(pointData.index === false) return [];\n\n var di = cd[pointData.index];\n var lc = trace.line.color;\n var mc = (trace.marker || {}).color;\n\n if(Color.opacity(lc) && trace.line.width) pointData.color = lc;\n else if(Color.opacity(mc) && trace.boxpoints) pointData.color = mc;\n else pointData.color = trace.fillcolor;\n\n pointData[pLetter + '0'] = pAxis.c2p(di.pos + t.bPos - boxDeltaNeg, true);\n pointData[pLetter + '1'] = pAxis.c2p(di.pos + t.bPos + boxDeltaPos, true);\n\n pointData[pLetter + 'LabelVal'] = di.orig_p !== undefined ? di.orig_p : di.pos;\n\n var spikePosAttr = pLetter + 'Spike';\n pointData.spikeDistance = dxy(di) * spikePseudoDistance / hoverPseudoDistance;\n pointData[spikePosAttr] = pAxis.c2p(di.pos, true);\n\n var hasMean = trace.boxmean || (trace.sizemode === 'sd') || (trace.meanline || {}).visible;\n var hasFences = trace.boxpoints || trace.points;\n\n // labels with equal values (e.g. when min === q1) should still be presented in the order they have when they're unequal\n var attrs =\n (hasFences && hasMean) ? ['max', 'uf', 'q3', 'med', 'mean', 'q1', 'lf', 'min'] :\n (hasFences && !hasMean) ? ['max', 'uf', 'q3', 'med', 'q1', 'lf', 'min'] :\n (!hasFences && hasMean) ? ['max', 'q3', 'med', 'mean', 'q1', 'min'] :\n ['max', 'q3', 'med', 'q1', 'min'];\n\n var rev = vAxis.range[1] < vAxis.range[0];\n\n if(trace.orientation === (rev ? 'v' : 'h')) {\n attrs.reverse();\n }\n\n var spikeDistance = pointData.spikeDistance;\n var spikePosition = pointData[spikePosAttr];\n\n var closeBoxData = [];\n for(var i = 0; i < attrs.length; i++) {\n var attr = attrs[i];\n\n if(!(attr in di)) continue;\n\n // copy out to a new object for each value to label\n var val = di[attr];\n var valPx = vAxis.c2p(val, true);\n var pointData2 = Lib.extendFlat({}, pointData);\n\n pointData2.attr = attr;\n pointData2[vLetter + '0'] = pointData2[vLetter + '1'] = valPx;\n pointData2[vLetter + 'LabelVal'] = val;\n pointData2[vLetter + 'Label'] = (t.labels ? t.labels[attr] + ' ' : '') + Axes.hoverLabelText(vAxis, val, trace[vLetter + 'hoverformat']);\n\n // Note: introduced to be able to distinguish a\n // clicked point from a box during click-to-select\n pointData2.hoverOnBox = true;\n\n if(attr === 'mean' && ('sd' in di) && ((trace.boxmean === 'sd') || (trace.sizemode === 'sd'))) {\n pointData2[vLetter + 'err'] = di.sd;\n }\n\n // no hovertemplate support yet\n pointData2.hovertemplate = false;\n\n closeBoxData.push(pointData2);\n }\n\n // only keep name and spikes on the median\n pointData.name = '';\n pointData.spikeDistance = undefined;\n pointData[spikePosAttr] = undefined;\n for(var k = 0; k < closeBoxData.length; k++) {\n if(closeBoxData[k].attr !== 'med') {\n closeBoxData[k].name = '';\n closeBoxData[k].spikeDistance = undefined;\n closeBoxData[k][spikePosAttr] = undefined;\n } else {\n closeBoxData[k].spikeDistance = spikeDistance;\n closeBoxData[k][spikePosAttr] = spikePosition;\n }\n }\n\n return closeBoxData;\n}\n\nfunction hoverOnPoints(pointData, xval, yval) {\n var cd = pointData.cd;\n var xa = pointData.xa;\n var ya = pointData.ya;\n var trace = cd[0].trace;\n var xPx = xa.c2p(xval);\n var yPx = ya.c2p(yval);\n var closePtData;\n\n var dx = function(di) {\n var rad = Math.max(3, di.mrc || 0);\n return Math.max(Math.abs(xa.c2p(di.x) - xPx) - rad, 1 - 3 / rad);\n };\n var dy = function(di) {\n var rad = Math.max(3, di.mrc || 0);\n return Math.max(Math.abs(ya.c2p(di.y) - yPx) - rad, 1 - 3 / rad);\n };\n var distfn = Fx.quadrature(dx, dy);\n\n // show one point per trace\n var ijClosest = false;\n var di, pt;\n\n for(var i = 0; i < cd.length; i++) {\n di = cd[i];\n\n for(var j = 0; j < (di.pts || []).length; j++) {\n pt = di.pts[j];\n\n var newDistance = distfn(pt);\n if(newDistance <= pointData.distance) {\n pointData.distance = newDistance;\n ijClosest = [i, j];\n }\n }\n }\n\n if(!ijClosest) return false;\n\n di = cd[ijClosest[0]];\n pt = di.pts[ijClosest[1]];\n\n var xc = xa.c2p(pt.x, true);\n var yc = ya.c2p(pt.y, true);\n var rad = pt.mrc || 1;\n\n closePtData = Lib.extendFlat({}, pointData, {\n // corresponds to index in x/y input data array\n index: pt.i,\n color: (trace.marker || {}).color,\n name: trace.name,\n x0: xc - rad,\n x1: xc + rad,\n y0: yc - rad,\n y1: yc + rad,\n spikeDistance: pointData.distance,\n hovertemplate: trace.hovertemplate\n });\n\n var origPos = di.orig_p;\n var pos = origPos !== undefined ? origPos : di.pos;\n var pa;\n if(trace.orientation === 'h') {\n pa = ya;\n closePtData.xLabelVal = pt.x;\n closePtData.yLabelVal = pos;\n } else {\n pa = xa;\n closePtData.xLabelVal = pos;\n closePtData.yLabelVal = pt.y;\n }\n\n var pLetter = pa._id.charAt(0);\n closePtData[pLetter + 'Spike'] = pa.c2p(di.pos, true);\n\n fillText(pt, trace, closePtData);\n\n return closePtData;\n}\n\nmodule.exports = {\n hoverPoints: hoverPoints,\n hoverOnBoxes: hoverOnBoxes,\n hoverOnPoints: hoverOnPoints\n};\n","'use strict';\n\nmodule.exports = {\n attributes: require('./attributes'),\n supplyDefaults: require('./defaults'),\n calc: require('./calc'),\n plot: require('./plot'),\n colorbar: require('./colorbar'),\n style: require('./style'),\n hoverPoints: require('./hover'),\n\n moduleType: 'trace',\n name: 'heatmap',\n basePlotModule: require('../../plots/cartesian'),\n categories: ['cartesian', 'svg', '2dMap', 'showLegend'],\n meta: {\n description: [\n 'The data that describes the heatmap value-to-color mapping',\n 'is set in `z`.',\n 'Data in `z` can either be a {2D array} of values (ragged or not)',\n 'or a 1D array of values.',\n\n 'In the case where `z` is a {2D array},',\n 'say that `z` has N rows and M columns.',\n 'Then, by default, the resulting heatmap will have N partitions along',\n 'the y axis and M partitions along the x axis.',\n 'In other words, the i-th row/ j-th column cell in `z`',\n 'is mapped to the i-th partition of the y axis',\n '(starting from the bottom of the plot) and the j-th partition',\n 'of the x-axis (starting from the left of the plot).',\n 'This behavior can be flipped by using `transpose`.',\n 'Moreover, `x` (`y`) can be provided with M or M+1 (N or N+1) elements.',\n 'If M (N), then the coordinates correspond to the center of the',\n 'heatmap cells and the cells have equal width.',\n 'If M+1 (N+1), then the coordinates correspond to the edges of the',\n 'heatmap cells.',\n\n 'In the case where `z` is a 1D {array}, the x and y coordinates must be',\n 'provided in `x` and `y` respectively to form data triplets.'\n ].join(' ')\n }\n};\n","'use strict';\n\n\nmodule.exports = {\n scattermode: {\n valType: 'enumerated',\n values: ['group', 'overlay'],\n dflt: 'overlay',\n editType: 'calc',\n description: [\n 'Determines how scatter points at the same location coordinate',\n 'are displayed on the graph.',\n 'With *group*, the scatter points are plotted next to one another',\n 'centered around the shared location.',\n 'With *overlay*, the scatter points are plotted over one another,',\n 'you might need to reduce *opacity* to see multiple scatter points.'\n ].join(' ')\n },\n scattergap: {\n valType: 'number',\n min: 0,\n max: 1,\n editType: 'calc',\n description: [\n 'Sets the gap (in plot fraction) between scatter points of',\n 'adjacent location coordinates.',\n 'Defaults to `bargap`.'\n ].join(' ')\n }\n};\n","'use strict';\n\nvar Color = require('../../components/color');\nvar hasColorscale = require('../../components/colorscale/helpers').hasColorscale;\nvar colorscaleDefaults = require('../../components/colorscale/defaults');\n\nvar subTypes = require('./subtypes');\n\n/*\n * opts: object of flags to control features not all marker users support\n * noLine: caller does not support marker lines\n * gradient: caller supports gradients\n * noSelect: caller does not support selected/unselected attribute containers\n */\nmodule.exports = function markerDefaults(traceIn, traceOut, defaultColor, layout, coerce, opts) {\n var isBubble = subTypes.isBubble(traceIn);\n var lineColor = (traceIn.line || {}).color;\n var defaultMLC;\n\n opts = opts || {};\n\n // marker.color inherit from line.color (even if line.color is an array)\n if(lineColor) defaultColor = lineColor;\n\n coerce('marker.symbol');\n coerce('marker.opacity', isBubble ? 0.7 : 1);\n coerce('marker.size');\n if(!opts.noAngle) {\n coerce('marker.angle');\n if(!opts.noAngleRef) {\n coerce('marker.angleref');\n }\n\n if(!opts.noStandOff) {\n coerce('marker.standoff');\n }\n }\n\n coerce('marker.color', defaultColor);\n if(hasColorscale(traceIn, 'marker')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.', cLetter: 'c'});\n }\n\n if(!opts.noSelect) {\n coerce('selected.marker.color');\n coerce('unselected.marker.color');\n coerce('selected.marker.size');\n coerce('unselected.marker.size');\n }\n\n if(!opts.noLine) {\n // if there's a line with a different color than the marker, use\n // that line color as the default marker line color\n // (except when it's an array)\n // mostly this is for transparent markers to behave nicely\n if(lineColor && !Array.isArray(lineColor) && (traceOut.marker.color !== lineColor)) {\n defaultMLC = lineColor;\n } else if(isBubble) defaultMLC = Color.background;\n else defaultMLC = Color.defaultLine;\n\n coerce('marker.line.color', defaultMLC);\n if(hasColorscale(traceIn, 'marker.line')) {\n colorscaleDefaults(traceIn, traceOut, layout, coerce, {prefix: 'marker.line.', cLetter: 'c'});\n }\n\n coerce('marker.line.width', isBubble ? 1 : 0);\n }\n\n if(isBubble) {\n coerce('marker.sizeref');\n coerce('marker.sizemin');\n coerce('marker.sizemode');\n }\n\n if(opts.gradient) {\n var gradientType = coerce('marker.gradient.type');\n if(gradientType !== 'none') {\n coerce('marker.gradient.color');\n }\n }\n};\n","'use strict';\n\nvar Lib = require('../../lib');\n\nfunction format(vRounded) {\n return (\n vRounded.indexOf('e') !== -1 ? vRounded.replace(/[.]?0+e/, 'e') :\n vRounded.indexOf('.') !== -1 ? vRounded.replace(/[.]?0+$/, '') :\n vRounded\n );\n}\n\nexports.formatPiePercent = function formatPiePercent(v, separators) {\n var vRounded = format((v * 100).toPrecision(3));\n return Lib.numSeparate(vRounded, separators) + '%';\n};\n\nexports.formatPieValue = function formatPieValue(v, separators) {\n var vRounded = format(v.toPrecision(10));\n return Lib.numSeparate(vRounded, separators);\n};\n\nexports.getFirstFilled = function getFirstFilled(array, indices) {\n if(!Lib.isArrayOrTypedArray(array)) return;\n for(var i = 0; i < indices.length; i++) {\n var v = array[indices[i]];\n if(v || v === 0 || v === '') return v;\n }\n};\n\nexports.castOption = function castOption(item, indices) {\n if(Lib.isArrayOrTypedArray(item)) return exports.getFirstFilled(item, indices);\n else if(item) return item;\n};\n\nexports.getRotationAngle = function(rotation) {\n return (rotation === 'auto' ? 0 : rotation) * Math.PI / 180;\n};\n","'use strict';\n\n\nmodule.exports = function doAvg(size, counts) {\n var nMax = size.length;\n var total = 0;\n for(var i = 0; i < nMax; i++) {\n if(counts[i]) {\n size[i] /= counts[i];\n total += size[i];\n } else size[i] = null;\n }\n return total;\n};\n","'use strict';\n\nmodule.exports = {\n attributes: require('./attributes'),\n layoutAttributes: require('./layout_attributes'),\n supplyDefaults: require('./defaults').supplyDefaults,\n crossTraceDefaults: require('./defaults').crossTraceDefaults,\n supplyLayoutDefaults: require('./layout_defaults').supplyLayoutDefaults,\n calc: require('./calc'),\n crossTraceCalc: require('./cross_trace_calc').crossTraceCalc,\n plot: require('./plot').plot,\n style: require('./style').style,\n styleOnSelect: require('./style').styleOnSelect,\n hoverPoints: require('./hover').hoverPoints,\n eventData: require('./event_data'),\n selectPoints: require('./select'),\n\n moduleType: 'trace',\n name: 'box',\n basePlotModule: require('../../plots/cartesian'),\n categories: ['cartesian', 'svg', 'symbols', 'oriented', 'box-violin', 'showLegend', 'boxLayout', 'zoomScale'],\n meta: {\n description: [\n 'Each box spans from quartile 1 (Q1) to quartile 3 (Q3).',\n 'The second quartile (Q2, i.e. the median) is marked by a line inside the box.',\n 'The fences grow outward from the boxes\\' edges,',\n 'by default they span +/- 1.5 times the interquartile range (IQR: Q3-Q1),',\n 'The sample mean and standard deviation as well as notches and',\n 'the sample, outlier and suspected outliers points can be optionally',\n 'added to the box plot.',\n\n 'The values and positions corresponding to each boxes can be input',\n 'using two signatures.',\n\n 'The first signature expects users to supply the sample values in the `y`',\n 'data array for vertical boxes (`x` for horizontal boxes).',\n 'By supplying an `x` (`y`) array, one box per distinct `x` (`y`) value is drawn',\n 'If no `x` (`y`) {array} is provided, a single box is drawn.',\n 'In this case, the box is positioned with the trace `name` or with `x0` (`y0`) if provided.',\n\n 'The second signature expects users to supply the boxes corresponding Q1, median and Q3',\n 'statistics in the `q1`, `median` and `q3` data arrays respectively.',\n 'Other box features relying on statistics namely `lowerfence`, `upperfence`, `notchspan`',\n 'can be set directly by the users.',\n 'To have plotly compute them or to show sample points besides the boxes,',\n 'users can set the `y` data array for vertical boxes (`x` for horizontal boxes)',\n 'to a 2D array with the outer length corresponding',\n 'to the number of boxes in the traces and the inner length corresponding the sample size.'\n ].join(' ')\n }\n};\n"],"names":["module","exports","attributes","require","supplyDefaults","supplyLayoutDefaults","layoutAttributes","calc","crossTraceCalc","plot","style","styleOne","moduleType","name","basePlotModule","categories","meta","description","join","isArrayOrTypedArray","hasColorscale","colorscaleDefaults","traceIn","traceOut","defaultColor","layout","coerce","opts","markerColor","marker","color","_inputArray","prefix","cLetter","noDash","backoff","Lib","Registry","constants","subTypes","handleXYDefaults","handlePeriodDefaults","handleStackDefaults","handleMarkerDefaults","handleLineDefaults","handleLineShapeDefaults","handleTextDefaults","handleFillColorDefaults","coercePattern","attr","dflt","len","visible","stackGroupOpts","scattermode","undefined","orientation","defaultMode","PTS_LINESONLY","hasMarkers","gradient","hasLines","hasText","dfltHoverOn","push","fillDflt","fill","fillcolor","lineColor","line","hoveron","errorBarsSupplyDefaults","getComponentMethod","axis","inherit","coerceSelectionMarkerOpacity","plots","gd","traces","transitionOpts","makeOnCompleteCallback","plotBasePlot","clean","newFullData","newFullLayout","oldFullData","oldFullLayout","cleanBasePlot","Color","hasMarkerColorscale","defaultLine","setGroupPositions","insertBlank","calcTrace","index","position","traceIndex","hasAnyBlanks","interpolate","posAttr","newEntry","i","gap","s","splice","prevEntry","pt0","pt1","getInterp","t","trace","plotinfo","_fullLayout","xa","xaxis","ya","yaxis","fullLayout","fullTraces","_fullData","calcTraces","calcdata","calcTracesHorz","calcTracesVert","length","fullTrace","type","_id","mode","scattergap","groupCrossTraceCalc","subplot","subplotStackOpts","_scatterStackOpts","j","k","i2","cd","cd0","posj","sumj","norm","groupOpts","groupnorm","valAttr","stackGroup","indices","traceIndices","stackgaps","Array","allPositions","serieslen","_rawLength","_length","cdj","sNorm","ppad","calcMarkerSize","arrayPad","isArray","ppadRaw","x","y","calcAxisExpansion","getDelay","_has","getRedrawFunc","encodeSVG","svg","encodeURIComponent","encodeJSON","json","DOM_URL","window","URL","webkitURL","createObjectURL","blob","revokeObjectURL","url","createBlob","format","Blob","binary","b","buf","ArrayBuffer","arr","Uint8Array","charCodeAt","fixBinary","atob","octetStream","document","location","href","IMAGE_URL_PREFIX","MSG_IE_BAD_FORMAT","helpers","saveLink","createElement","canUseSaveLink","Promise","resolve","reject","objectUrl","isIE","navigator","msSaveBlob","download","body","appendChild","click","removeChild","isSafari","Error","inheritColorFromMarker","markerLineColor","addOpacity","perStackAttrs","stackOpts","firstTrace","dflts","attrFound","traceHasAttr","isOrientation","trace2","_input","min","max","Axes","getAxisGroup","orientations","setPositionOffset","traceType","boxList","posAxis","axId","axLetter","charAt","pointList","shownPts","c2l","pos","pts2","boxdv","distinctVals","minDiff","dPos0","minDtick","vals","numTotal","group","groupFraction","groupGapFraction","dPos","bdPos","bPos","wHover","pushplus","pushminus","width","side","groupId","alignmentGroupOpts","_alignmentOpts","alignmentgroup","nOffsetGroups","Object","keys","offsetGroups","num","_offsetIndex","edgeplus","edgeminus","vpadplus","vpadminus","ppadplus","ppadminus","edge","padded","Boolean","boxpoints","points","pointpos","jitter","ms","size","pp","pm","_extremes","findExtremes","vpadLinearized","empty","getCentroid","d","isHorizontal","isFunnel","x0","c2p","s0","p0","x1","s1","p1","y0","y1","searchInfo","selectionTester","selection","selected","di","ct","contains","pointNumber","c2d","d3","Drawing","sel","select","selectAll","opacity","each","el","this","lineWidth","styleBox","boxSel","fillColor","call","stroke","allBoxes","boxData","thisBox","container","dir","selectedpoints","pts","pointStyle","styleOnSelect","selectedPointStyle","isNumeric","factor","sizeRef","sizeref","sizeMin","sizemin","baseFn","sizemode","v","Math","sqrt","baseSize","BADNUM","zOld","rowlen","collen","getCollen","old2new","cleanZvalue","transpose","padOld2new","axisMapping","ax","axMapping","traceCategories","ind","_categories","identity","xMap","yMap","zNew","mergeArray","text","hovertext","markerLine","mergeArrayCastPositive","pt","pattern","shape","version","numConstants","oneYear","ONEAVGYEAR","oneMonth","ONEAVGMONTH","oneDay","ONEDAY","oneHour","ONEHOUR","oneMin","ONEMIN","oneSec","ONESEC","tickIncrement","biggestDigitChanged","v1","v2","pa","calendar","Infinity","dv","abs","isDate","digit","biggestGuaranteedDigitChanged","nextDigit","didDigitChange","pow","floor","log","LN10","dateParts1","dateParts","dateParts2","parti","parts","split","unshift","leftGap","rightGap","binEdges","disambiguateEdges","dv0","dv1","dv2","edge0","edge1","leftDigit","rightDigit","dashExclude","increment","isRightEdge","dateStr","dashPos","indexOf","substr","roundedV","d2c","nextV","round","alignPeriod","calcColorscale","arraysToCalcdata","calcSelection","xId","yId","firstScatter","_firstScatter","firstScatterGroup","uid","stackOrientation","getStackOpts","_minDtick","xOptions","yOptions","openEnded","tozero","error_y","markerTrans","setConvert","makeCalcdata","sizeOut","setFirstScatter","stackgroup","stackAx","isV","vali","_xA","getFromId","_yA","origX","origY","xObj","yObj","ids","interpolateGaps","xAttr","yAttr","pushUnique","_expandedIndex","hasPeriodX","xperiodalignment","hasPeriodY","yperiodalignment","cdi","xValid","yValid","orig_x","xEnd","ends","xStart","starts","orig_y","yEnd","yStart","id","String","sort","a","pos0","size0","m","tinycolor","svgTextUtils","formatLabels","extractOpts","makeColorScaleFuncFromTrace","xmlnsNamespaces","LINE_SPACING","supportsPixelatedImage","PIXELATED_IMAGE_STYLE","labelClass","selectLabels","plotGroup","removeLabels","remove","findInterp","pixel","pixArray","maxBin","bin","constrain","findBin","pix0","pix1","interp","bin0","frac","bin1","findInterpFromCenters","centerPixArray","putColor","pixels","pxIndex","c","cdheatmaps","heatmapLayer","makeTraceGroups","left","right","temp","top","bottom","xGap","xgap","yGap","ygap","z","xc","xCenter","yc","yCenter","isContour","traceIs","zsmooth","n","maxRowLength","xrev","yrev","xfill","yfill","drawingMethod","_islinear","extra","canvasW","canvasH","imageWidth","imageHeight","data","exit","canvas","height","xpx","ypx","context","getContext","willReadFrequently","sclFunc","noNumericCheck","returnArray","xb","xi","row","yi","yb","xbi","ybi","pixcount","rcount","gcount","bcount","setColor","pixsize","interpColor","r0","r1","xinterp","yinterp","z00","dxy","z01","z10","z11","dx","dy","e","xForPx","yForPx","xPixArray","yPixArray","xinterpArray","findInterpX","findInterpY","imageData","createImageData","set","pxArray","dlen","putImageData","xGapLeft","yGapTop","reverse","fillStyle","fillRect","avgColor","_hmpixcount","_hmlumcount","getLuminance","image3","enter","append","xmlns","preserveAspectRatio","toDataURL","texttemplate","cOpts","dummyAx","range","_separators","_numFormat","aHistogram2dContour","aContour","iStop","jStart","jStop","textData","yVal","_y","xVal","_x","obj","zVal","zLabel","tickText","theText","_t","texttemplateString","_d3locale","_meta","lines","nL","nC","l","font","textfont","fontFamily","family","fontSize","globalFontSize","minW","minH","maxL","maxC","nextD","isFinite","classed","thisLabel","fontColor","contrast","positionText","xFn","yFn","convertToTspans","axisHoverFormat","texttemplateAttrs","hovertemplateAttrs","colorScaleAttrs","fontAttrs","dash","extendFlat","axisPeriod","valType","editType","axisPeriod0","axisPeriodAlignment","values","anim","xperiod","yperiod","xperiod0","yperiod0","xhoverformat","yhoverformat","offsetgroup","arrayOk","flags","extras","hovertemplate","eventDataKeys","smoothing","simplify","connectgaps","cliponaxis","fillpattern","symbol","symbolList","angle","angleref","standoff","maxdisplayed","unselected","textposition","colorEditType","out","hoverOnBox","boxmode","boxgap","boxgroupgap","barmode","barnorm","bargap","bargroupgap","barcornerradius","customdata","markerGradient","extendDeep","cloneLayoutOverride","tileClass","override","autosize","title","showlegend","margin","r","pad","annotations","hidesources","borderwidth","bordercolor","graphObj","options","keyName","oldData","oldLayout","newData","newLayout","_context","slice","showscale","sceneIds","filter","key","match","axesImageOverride","showaxeslabels","showticklabels","linetickenable","scene","zaxis","_scene","className","plotTile","td","config","staticPlot","plotGlPixelRatio","displaylogo","showLink","showTips","mapboxAccessToken","setBackground","defaultLayout","dateTick0","ONEWEEK","getPeriod0Dflt","period","xcalendar","ycalendar","histogram2dCalc","colorscaleCalc","convertColumnData","clean2dArray","interp2d","findEmpties","makeBoundArray","skipBreaks","binned","isHist","isGL2D","zIn","isArray1D","_z","noZsmooth","msg","warn","scaleIsLinear","avgdx","maxErrX","rangebreaks","newZ","dropZonBreaks","_emptypoints","xlen","xIn","xtype","xArray","yIn","ytype","yArray","_text","_hovertext","xRanges","yRanges","contours","coloring","dummyTrace","fontDflt","coerceFont","handleGroupingDefaults","autoType","handleSampleDefaults","getDims","dims","valid","astr","validate","sLen","q1","median","q3","_hasPreCompStats","minRowLength","defaultOrientation","yDims","xDims","yLen","xLen","autotypenumbers","setInX","hasCategories","handleCalendarDefaults","handlePointsDefaults","outlierColorDflt","coerce2","lineoutliercolor","modeDflt","hasPreCompStats","boxmeanDflt","mean","sd","boxmean","notchedDflt","notchspan","notchwidth","crossTraceDefaults","fullData","scatterAttrs","textFontAttrs","markerLineWidth","cornerradius","insidetextanchor","textangle","insidetextfont","outsidetextfont","constraintext","base","offset","_deprecated","bardir","coerceString","attributeDefinition","value","defaultValue","noBlank","strict","coerceNumber","coerceColor","isValid","coerceEnumerated","getValue","arrayOrScalar","getLineWidth","mlw","isTypedArraySpec","isBubble","isPlainObject","ax1","ax2","var1Name","var2Name","arrayVarNames","colLen","col1","col2","textCol","hasColumnText","hoverTextCol","hasColumnHoverText","col1dv","col1vals","col2dv","col2vals","newArrays","nI","nJ","init2dArray","after2before","i1","arrayVar","map","_after2before","uniformText","recordMinTextSize","clearMinTextSize","attributeText","attributeTextPosition","appendArrayPointValue","TEXTPAD","keyFunc","getKeyFunc","sign","dirSign","transition","onComplete","uniformtext","hasTransition","duration","ease","easing","textfitsInsideBar","barWidth","barHeight","textWidth","textHeight","getRotateFromAngle","getRotatedTextSize","textBB","rotate","PI","absSin","sin","absCos","cos","toMoveInsideBar","constrained","anchor","isEnd","isStart","toRight","leftToRight","toLeft","hasB","overhead","lx","ly","textpad","scale","padForRounding","scaleAndPad","R","clippedR","rX","rY","scaleTextForRoundedBar","textX","textY","targetX","targetY","anchorX","anchorY","extrapad","cdModule","traceLayer","isStatic","groupgap","bartraces","isWaterfall","isHistogram","isBar","shouldDisplayZeros","adjustPixel","connector","withTransition","pointGroup","ensureSingle","bars","lw","mc","bar","xy","p","sAxis","pAxis","getXY","isBlank","cont","roundWithLine","fixpx","vc","hideZeroSpan","ceil","outerBound","_sMax","_sMin","path","h","crValue","crForm","crPx","barLength","stackedBarTotalLength","maxRadius","calcCornerRadius","cornerradiusvalue","cornerradiusform","rectanglePath","refPoint","xdir","ydir","cornersweep","dy1","dy2","xminfunc","dx1","dx2","yminfunc","isNaN","setClipUrl","layerClipId","styleFns","makePointStyleFns","singlePointStyle","textPosition","appendTextNode","class","castOption","pLetter","vLetter","vAxis","formatLabel","u","formatNumber","label","labelLabel","tx","valueLabel","xLabel","yLabel","delta","rawS","deltaLabel","final","finalLabel","initial","initialLabel","percentInitial","begR","percentInitialLabel","formatPercent","percentPrevious","difR","percentPreviousLabel","percentTotal","sumR","percenTotalLabel","calcTexttemplate","textinfo","hasFlag","flag","nPercent","hasMultiplePercents","calcTextinfo","getText","getTextPosition","inStackOrRelativeMode","calcBar","isOutmostBar","_outmost","barIsRounded","layoutFont","barColor","getBarColor","insideTextFont","getInsideTextFont","outsideTextFont","getOutsideTextFont","datum","textSelection","ensureUniformFontSize","bBox","node","fitsInside","textHasSize","currentTransform","transform","toMoveOutsideBar","setTransormAndDisplay","appendBarText","hideOutsideRangePoint","hasClipOnAxisFalse","fillOne","Fx","getTraceColor","fillText","pointData","xval","yval","hovermode","minRad","xPeriod","yPeriod","rad","mrc","distfn","getDistanceFunction","kink","dxRaw","dyRaw","getClosest","sizeVal","xLabelVal","yLabelVal","spikeDistance","isHoverPointInFillElement","svgElement","domPoint","DOMPoint","isPointInFill","TypeError","svgPoint","ownerSVGElement","createSVGPoint","_fillElement","_fillExclusionElement","hoverLabelCoords","polygons","yPos","xAtYPos","polygonsIn","xmin","xmax","ymin","ymax","polygon","getHoverLabelPosition","_polygons","distance","maxHoverDistance","linePoints","linkTraces","polygonTester","plotOne","idx","cdscatter","cdscatterAll","element","xr","extent","simpleMap","r2c","yr","mnum","inc","tnum","forEach","tracei","i0","vis","selectMarkers","tr","errorBarGroup","ownFillEl3","tonext","fillAxisIndex","fillAxisZero","ownFillDir","isRangePlot","thispath","thisrevpath","prevRevpath","prevPolygons","prevtrace","_prevtrace","prevFillsegments","prevFillElement","_prevRevpath","_nextFill","_ownPolygons","_fillsegments","pathfn","revpathbase","revpathfn","lastSegment","fullpath","revpath","thisPolygons","fillsegments","segments","makeUpdate","noop","_ownFill","steps","pLast","smoothclosed","smoothopen","connectGaps","baseTolerance","fillsegmentCount","curpoints","apply","isEnter","lineGroupStyle","singleLineStyle","lineJoin","makeSelfPolygons","makePolygonsToPrevious","reversedPrevFillsegment","concat","polypoints","singleFillStyle","clearFill","showMarkers","showText","markerFilter","hideFilter","textFilter","showFilter","isInferZero","_needsCull","visFilterWithGaps","visFilter","gapFilter","translatePoints","order","translatePoint","g","textPointStyle","makePoints","clipUrl","scatterLayer","isFullReplot","cdscatterSorted","traceJoin","fills","fillData","_ownfill","_nexttrace","fillJoin","createFills","getMinKey","minKey","minSize","minsize","hide","resizeText","gTrace","selector","shouldHide","count","sum","counterData","Number","avg","counts","Loggers","addStyleRule","ExtendModule","basePlotAttributes","baseLayoutAttributes","extendDeepAll","registerTraceModule","_module","thisType","categoriesIn","modules","subplotsRegistry","plotType","componentName","findArrayRegexps","componentsRegistry","mergeComponentAttrsToSubplot","registerSubplot","categoryObj","allCategories","allTypes","mergeComponentAttrsToTrace","traceLayoutAttributes","bpmName","styleRules","PlotlyGeoAssets","topojson","registerComponentModule","_isLinkedToArray","layoutArrayContainers","subplotName","transformType","transformsRegistry","mergeComponentAttrsToTransform","schema","registerTransformModule","hasTransform","hasCalcTransform","calcTransform","registerLocale","locale","baseLocale","newDict","dictionary","newFormat","hasDict","hasFormat","locales","localeRegistry","localeObj","baseLocaleObj","arrayAttrRegexps","_arrayAttrRegexps","layoutArrayRegexes","componentSchema","traceAttrs","transforms","transformAttrs","subplots","subplotModule","subplotAttrs","subplotAttr","componentLayoutAttrs","getTraceType","apiMethodRegistry","collectableSubplotTypes","register","_modules","newModule","fn","getModule","category","getTransformIndices","method","arguments","args","Snapshot","clone","toSVG","svgToImg","toImage","downloadImage","tagSelected","labels","mockGd","getFromTrace","colorbar","hoverPoints","eventData","selectPoints","animatable","LOG_CLIP","LOG_CLIP_PLUS","LOG_CLIP_MINUS","segmentsIntersect","clusterStartPt","clusterEndPt","clusterHighPt","clusterLowPt","thisPt","clusterHighFirst","clusterUnitVector","thisVector","clusterRefDist","clusterHighVal","clusterLowVal","thisVal","clusterMinDeviation","clusterMaxDeviation","thisDeviation","latestXFrac","latestYFrac","xLog","yLog","linear","minTolerance","pti","getPt","linearized","l2p","_m","crossesViewport","xFrac0","yFrac0","xFrac1","yFrac1","dx0","dy0","norm2","dot","cross","getTolerance","nextPt","xFrac","yFrac","offScreenFraction","toleranceGrowth","ptDist","pt2","xEdge","yEdge","lastXEdge","lastYEdge","lastFarPt","edgePt","getEdgeIntersections","maxScreensAway","xEdge0","xEdge1","yEdge0","yEdge1","edges","onlyConstrainedPoint","sameEdge","getABAEdgeIntersections","dim","limit0","limit1","ptInt1","ptInt2","midShift","updateEdge","xSame","ySame","xSame2","ySame2","updateEdgesForReentry","ptCount","ptInt","arrayMarker","addPt","intersections","lastPt","getClosestCorner","lastShapeChar","trimmed","newSegments","start","end","applyBackoff","coordDefaults","coordStr","coord","xName","yName","ylen","zi","allRowsAreArrays","oneRowIsFilled","hasOneNumber","isValidZ","barAttrs","colorAttrs","scatterMarkerAttrs","scatterMarkerLineAttrs","lowerfence","upperfence","notched","sdmultiple","quartilemethod","outliercolor","outlierwidth","whiskerwidth","showwhiskers","xl","yl","nx","ny","zmask","zhoverformat","x2","y2","error","inbox","hoverongaps","hoverformat","maxSpikeDistance","zLabelVal","stylePoints","styleText","fillGroupStyle","selectedTextStyle","LINKEDFILLS","tonextx","tonexty","groupIndex","groupIndices","needsSort","prevGroupIndex","nextGroupIndex","prevUnstackedGroupIndex","_groupIndex","traceA","traceB","prevtraces","Plots","strScale","strTranslate","isValidTextValue","attachFxHandlers","sliceTop","cx","cy","isFunnelArea","_hasHoverLabel","_hasHoverEvent","on","fullLayout2","_dragging","hoverinfo","castHoverinfo","rInscribed","hoverCenterX","pxmid","hoverCenterY","separators","formatPieValue","percent","vTotal","percentLabel","formatPiePercent","hoverLabel","hoverlabel","hoverFont","bbox","loneHover","_x0","TL","_x1","TR","_y0","_y1","BL","idealAlign","bgcolor","borderColor","nameLength","namelength","textAlign","align","hovertemplateLabels","_hoverlayer","outerContainer","_paper","inOut_bbox","emit","event","evt","originalEvent","loneUnhover","_hoverdata","determineInsideTextFont","customColor","prerenderTitles","txt","templateString","dummyTitle","tester","titleBox","transformInsideText","rpx1","startangle","stopangle","rCenter","textPosAngle","newT","ring","isCircle","halfAngle","halfangle","midAngle","midangle","insidetextorientation","isTangential","isRadial","isAuto","allTransforms","considerCrossing","stop","isCrossing","dStart","dStop","closestEdge","calcTanTransform","calcRadTransform","textDiameter","maxScale","calcMaxHalfSize","calcRCenter","calcRotate","q","tan","getInscribedRadiusFraction","hole","transformOutsideText","outside","positionTitleOutside","plotSize","scaleX","scaleY","maxPull","topMiddle","translate","ty","getMaxPull","aspectratio","rx","maxWidth","w","domain","getTitleSpace","pieBoxHeight","pull","layoutAreas","scaleGroups","ry","scalegroup","area","baseratio","groupScale","getCoords","formatSliceLabel","hasLabel","hasValue","hasPercent","getFirstFilled","makeTemplateVariables","ptTx","computeTransform","cosA","sinA","midX","midY","noCenter","gs","_size","plotGroups","_pielayer","currentCoords","currentAngle","getRotationAngle","rotation","angleFactor","firstPt","direction","hidden","largeArc","setCoords","slices","quadrants","hasOutsideText","curveNumber","slicePath","cxFinal","cyFinal","outerCircle","px0","arc","outerArc","px1","rim","sliceTextGroup","sliceText","determineOutsideTextFont","newFont","textXY","yLabelMin","yLabelMid","yLabelMax","labelExtraX","labelExtraY","finish","cw","titleTextGroup","titleText","positionTitleInside","xHalf","yHalf","equatorFirst","farthestX","farthestY","xDiffSign","yDiffSign","thisQuad","oppositeQuad","wholeSide","thisQuadOutside","firstOppositeOutsidePt","topFirst","bottomFirst","scootOneLabel","prevPt","xBuffer","otherPt","newExtraX","prevOuterY","thisInnerY","thisOuterY","thisSliceOuterY","newExtraY","scootLabels","lineStartX","textLinePath","finalX","yFromX","yNet","plotTextLines","automargin","traceBbox","vpw","vph","autoMargin","yt","setTimeout","Sieve","sa","excluded","included","_base","scalendar","hasBase","initBase","setGroupPositionsInOverlayMode","sieve","sepNegVal","overlapNoMerge","positions","distinctPositions","nTraces","overlap","barGroupWidth","alignmentGroups","barWidthPlusGap","offsetFromCenter","barwidth","poffset","bargroupwidth","bardelta","binWidth","applyAttributes","setBarCenterAndWidth","updatePositionAxis","setOffsetAndWidthInGroupMode","inTraceSieve","put","unhideBarsWithinTrace","sieveBars","normalizeBars","setBaseAndTop","setGroupPositionsInGroupMode","cr","standardizeCornerradius","setOffsetAndWidth","sLetter","getAxisLetter","stackBars","get","setGroupPositionsInStackOrRelativeMode","setCornerradius","extents","pMin","pMax","roundFactor","sMinByPos","sMaxByPos","anyTraceHasCornerradius","some","poffsetIsArray","pVal","sMin","sMax","setHelperValuesForRoundedCorners","collectExtents","newPoffset","calcTrace0","_offset","initialPoffset","prototype","_width","initialBarwidth","newBarwidth","barwidthIsArray","allowMinDtick","vpad","calcBarOffset","calcBarWidth","isScatter","isVertical","sTop","sTiny","l2c","needsPadding","_computePh","ph0","ph1","xCat","yCat","binFunctions","normFunctions","doAvg","getBinSpanLabelRound","calcAllAutoBins","mainData","_overlayEdgeCase","autoVals","cumulativeSpec","binAttr","groupName","binOpts","_histogramBinOpts","isOverlay","c2r","cleanBound","cleanDate","setBound","bins","newBins","nestedProperty","allPos","isFirstVisible","has2dMap","hasHist2dContour","mainDatai","dirs","_autoBin","newBinSpec","autoBin","nbins","sizeFound","_dataSpan","bingroup","xbins","overlaidTraceGroup","xid","yid","getConnectedHistograms","pastThisTrace","singleValuedTraces","resulti","binSpeci","isSingleValued","dataVals","handleSingleValueOverlays","cumulative","enabled","currentbin","traceInputBins","traceBinOptsCalc","mainStart","startIn","r2l","hasStart","startFound","traceStart","aggNums","dtick","tick0","l2r","newStart","tickFirst","mainEnd","endIn","hasEnd","endFound","traceEnd","autoBinAttr","binEnd","binsAndPos","binSpec","nonuniformBins","inputPoints","total","histnorm","func","histfunc","densityNorm","replace","rawCounterData","sizeInit","binFunc","normFunc","isAvg","pr2c","_roundFnOpts","roundFnOpts","roundFn","nMax","uniqueValsPerBin","ptNumber2cdIndex","posi","currentBin","vi","prevSum","firstHalfPoint","nextHalfPoint","pop","shift","cdf","seriesLen","firstNonzero","lastNonzero","width1","attributeTextFont","attributeInsideTextFont","attributeOutsideTextFont","styleTextPoints","determineFont","textFont","getTextFont","getFontValue","defaultFont","attributeValue","familyValue","sizeValue","colorValue","mcc","barcount","txs","selectedFontColor","styleTextInSelectionMode","stylePointsInSelectionMode","fileSaver","_gd","getGraphDiv","imageDataOnly","_snapshotInProgress","promise","filename","then","result","catch","err","layoutIn","layoutOut","groupBarmode","posAxId","alignmentOpts","alignmentIndex","offsetGroupOpts","offsetIndex","prevRow","neighborCount","newNeighborHash","foundNewNeighbors","empties","neighborHash","noNeighborList","nextRow","blank","rowLength","point","vs","inside","xj","yj","subtypes","validateCornerradius","hasBars","shouldBeGapless","gappedAnyway","usedSubplots","subploti","EventEmitter","clonePlot","ev","clonedGd","redrawFunc","delay","randstr","emitter","lc","tc","mlc","mlcc","extendedColorWayList","makePullColorFn","colorMap","getAlpha","generateExtendedColors","colorList","extendedColorWays","colorString","JSON","stringify","colors","lighten","toHexString","darken","hiddenLabels","hiddenlabels","hasValues","_hasValues","dlabel","label0","allThisTraceLabels","pullColor","isAggregated","thisLabelIndex","elem","desiredType","colorWay","dfltColorCount","colorway","baseAttrs","domainAttrs","titlefont","titleposition","plotBoxAndWhiskers","axes","bdPos0","bdPos1","valAxis","val","posHasRangeBreaks","wdPos","bPosPxOffset","whiskerWidth","showWhiskers","nw","paths","box","lcenter","pos1","posc","posw0","posw1","posm0","posm1","sdmode","med","useExtremes","lf","uf","ln","un","plotPoints","seedPseudoRandom","gPoints","newJitter","typicalSpread","minSpread","spreadLimit","jitterFactors","maxJitterFactor","pmin","pmax","jitterFactor","jitterOffset","pseudoRandom","posPx","uo","lo","so","plotBoxMean","meanline","sl","sh","cdbox","boxLayer","origPos","pObj","hasPeriod","sizeOpts","msUTC","orig_p","containerStr","piecolorway","extendpiecolors","_","valLetter","posLetter","numKey","boxVals","N","allPosArrays","hasPosArray","hasPos0","hasPosStep","isDateTime","pos0c","r2c_just_indices","getPosArrays","posArray","posDistinct","ptFilterFn","valArrayRaw","minVal","maxVal","sortByVal","extractVal","computeLowerFence","computeUpperFence","stdev","computeLowerOutlierBound","computeUpperOutlierBound","ns","computeNotchSpan","imin","imax","v0","valArray","posBins","makeBins","pLen","ptsPerBin","initNestedArray","minLowerNotch","maxUpperNotch","usesExclusive","usesInclusive","lower","upper","mci","isTypedArray","from","TRACE_TO_CALC","ptNumber","o","probability","density","yinc","traceSelection","handleDomainDefaults","handleText","handleLabelsAndValues","hasLabels","hasPositive","isPie","paper_bgcolor","markerColors","fgcolor","res","_hasLabels","textInfo","textTemplate","moduleHasSelected","moduleHasUnselected","moduleHasConstrain","moduleHasCliponaxis","moduleHasTextangle","moduleHasInsideanchor","titlePosition","Image","ieSvgError","svgBlob","w0","h0","w1","h1","ctx","img","onload","imgData","drawImage","errorMsg","onerror","src","filli","tracej","getLabel","oldValue","NEIGHBORSHIFTS","correctionOvershoot","maxFractionalChange","iterateInterp2d","emptyPoints","overshoot","neighborShift","neighborRow","neighborVal","neighborSum","initialVal","minNeighbor","maxNeighbor","appendArrayMultiPointValues","pointNumbers","handleXYZDefaults","handleHeatmapLabelDefaults","handleStyleDefaults","noSelect","hoverLabelText","hoverOnBars","posVal","sizeLetter","pRangeCalc","isClosest","sizeFn","positionFn","isClosestOrPeriod","thisBarMinPos","thisBarExtPos","thisBarMaxPos","sgn","periodLength","minPos","maxPos","_minPos","_maxPos","maxDistance","finiteRange","getSize","baseLabel","thisBarSizeFn","thisBarPositionFn","barPointData","trim","hasPathbar","hasBoth","hasInside","hasOutside","dfltFont","insideTextFontDefault","isColorInheritedFromLayoutFont","pathbarTextFontDefault","arrayIn","v0In","dvIn","numbricks","arrayOut","_supply","hasTraceType","DOUBLEQUOTE_REGEX","DUMMY_SUB","DUMMY_REGEX","RegExp","toppaper","_toppaper","insert","setRect","basePlotModules","_basePlotModules","nodes","childNodes","topGroups","topGroup","_draggers","background","visibility","display","ff","setAttributeNS","xlink","XMLSerializer","serializeToString","hiddenDiv","html","replaced","htmlEntityDecode","impliedEdits","autoSize","autoColor","autoColorDflt","makeIncrements","nonuniform","binsToCalc","getRanges","uniqueVals","gapLow","gapHigh","xr2c","yr2c","xBinsAndPos","xBinSpec","xPos0","yBinsAndPos","yBinSpec","yPos0","onecol","zerocol","nonuniformBinsX","nonuniformBinsY","xEdges","yEdges","ybins","densitynorm","sizeinit","binfunc","normfunc","doavg","xinc","xBinSize","xBinStart","xBinEnd","yBinSize","yBinStart","yBinEnd","ipCol","yc2r","uniqueValsPerX","uniqueValsPerY","xVals","yVals","xGapLow","xGapHigh","yGapLow","yGapHigh","hoverOnBoxes","vVal","hoverPseudoDistance","spikePseudoDistance","boxDeltaPos","boxDeltaNeg","dVal","isViolin","boxDelta","posAcceptance","shiftPos","span","pseudoDistance","spikePosAttr","hasMean","hasFences","attrs","rev","spikePosition","closeBoxData","valPx","pointData2","hoverOnPoints","closePtData","xPx","yPx","quadrature","ijClosest","newDistance","noAngle","noAngleRef","noStandOff","noLine","vRounded","toPrecision","numSeparate","array","item"],"sourceRoot":""}